.library-sync-dialog p {
  color: var(--library-muted);
  font-size: 14px;
  line-height: 1.6;
}

.library-dialog-header button {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--library-muted);
  cursor: pointer;
}

.library-sync button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--library-accent);
  font: inherit;
  cursor: pointer;
}

.personal-library {
  --library-text: #e5e7eb;
  --library-muted: #a4adb8;
  --library-border: #34404b;
  --library-background: #101418;
  --library-accent: #71d9cd;

  max-width: 1120px;
}

html.light .personal-library {
  --library-text: #17252c;
  --library-muted: #52616b;
  --library-border: #cdd9dc;
  --library-background: #fff;
  --library-accent: #006e64;
}

.personal-library [hidden] {
  display: none !important;
}

.personal-library .my-hero,
html.light .personal-library .my-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 0;
  background: none;
  border: 0;
  align-items: center;
  margin-bottom: 12px;
}

.library-sync {
  color: var(--library-muted);
  font-size: 14px;
  line-height: 1.5;
}


.personal-library .my-secondary,
html.light .personal-library .my-secondary {
  min-height: 44px;
  color: var(--library-accent);
  background: var(--library-background);
}

.personal-library .my-primary {
  background: var(--library-accent);
  color: #101418;
}

html.light .personal-library .my-primary {
  background: var(--library-accent);
  color: #fff;
}

.personal-library .my-hero p {
  max-width: 650px;
  font-size: 14px;
}

.library-create {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  margin-bottom: 16px;
  border: 1px solid var(--library-border);
  border-radius: 8px;
  color: var(--library-accent);
  text-decoration: none;
}

.library-controls {
  margin: 18px 0;
  color: var(--library-text);
}

.library-controls label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}

.library-controls input,
.library-controls select,
.library-controls button,
.library-pagination button,
.library-notice button {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--library-border);
  border-radius: 8px;
  background: var(--library-background);
  color: var(--library-text);
  font: inherit;
}

.library-controls input {
  width: 100%;
  font-size: 16px;
}

.library-controls input::placeholder {
  color: var(--library-muted);
  opacity: 0.85;
  font-size: 14px;
}

.library-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.library-filters select {
  width: 100%;
  min-width: 0;
}

.library-ready .library-results > .my-section-head {
  display: none;
}

.personal-library .gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.personal-library .saved-team-card {
  display: flex;
  gap: 10px;
  padding: 16px;
  min-width: 0;
  border-color: var(--library-border);
  background: var(--library-background);
  color: var(--library-text);
}

.personal-library .library-preview {
  display: block;
  width: 100%;
  max-width: 300px;
}

.personal-library .gallery-card-sprites {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.personal-library .gallery-card.is-private .gallery-card-sprites {
  padding-right: 0;
}

.personal-library .private-lock {
  top: 12px;
  right: 12px;
  background: var(--library-background);
}

.personal-library .gallery-card-name {
  white-space: normal;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.library-name {
  color: var(--library-text);
  text-decoration: none;
}

.library-name:hover {
  text-decoration: underline;
}

.personal-library .gallery-card-meta {
  color: var(--library-muted);
  font-size: 12px;
}

.library-kind {
  color: var(--library-muted);
  font-size: 12px;
}

.personal-library .my-teams-badge.saved {
  display: none;
}

.personal-library .saved-card-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: 8px;
  align-items: stretch;
}

.personal-library .saved-card-actions a,
.personal-library .saved-card-actions button,
.library-menu summary {
  min-width: 44px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--library-border);
  border-radius: 7px;
  background: var(--library-background);
  color: var(--library-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.library-menu {
  position: relative;
}

.library-menu summary {
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
}

.library-menu summary::-webkit-details-marker {
  display: none;
}

.library-menu-options {
  position: absolute;
  z-index: 5;
  right: 0;
  top: calc(100% + 4px);
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 6px;
  background: var(--library-background);
  border: 1px solid var(--library-border);
  border-radius: 8px;
  box-shadow: 0 6px 20px #0003;
}

.personal-library .library-menu-options button {
  justify-content: flex-start;
  color: var(--library-text);
}

.library-notice {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--library-border);
  border-radius: 8px;
  background: var(--library-background);
}

.library-pagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.library-pagination button:disabled {
  opacity: 0.5;
}

.personal-library :focus-visible {
  outline: 2px solid var(--library-muted);
  outline-offset: 1px;
}

.personal-library .gallery-empty {
  color: var(--library-muted);
}

@media (width <= 600px) {
  .personal-library .gallery-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .library-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .personal-library .my-hero h1 {
    font-size: 26px;
  }

  .personal-library .my-actions a {
    min-height: 44px;
  }
}


.library-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}



.library-sync-dialog {
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 440px;
  padding: 24px;
  border: 1px solid var(--library-border);
  border-radius: 8px;
  background: var(--library-background);
  color: var(--library-text);
}

.library-sync-dialog::backdrop {
  background: #0009;
}

.library-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.library-dialog-header h2 {
  margin: 0;
  font-size: 20px;
}





.library-sync-dialog .my-actions {
  display: grid;
  gap: 8px;
}

.library-controls .library-search {
  position: relative;
  font-weight: 400;
}

.library-search > .library-icon {
  position: absolute;
  top: 13px;
  left: 13px;
  pointer-events: none;
  color: var(--library-muted);
}

.library-search input {
  padding-left: 40px;
  font-weight: 400;
}


.library-advanced {
  margin-top: 6px;
}

.library-advanced summary {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  min-height: 44px;
  color: var(--library-muted);
  font-size: 13px;
  cursor: pointer;
  list-style: none;
}

.library-advanced summary::-webkit-details-marker {
  display: none;
}

.library-advanced summary::after {
  content: '';
  width: 6px;
  height: 6px;
  margin-left: 4px;
  border-right: 1.5px solid currentcolor;
  border-bottom: 1.5px solid currentcolor;
  transform: rotate(45deg) translateY(-2px);
}

.library-advanced[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.library-advanced .library-filters {
  margin-top: 4px;
  margin-bottom: 16px;
}

.personal-library .library-status {
  margin: 8px 0 12px;
  color: var(--library-muted);
  font-size: 12px;
  line-height: 1.5;
}

.personal-library .recent-actions a,
.personal-library .recent-actions button,
.personal-library .history-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  color: var(--library-accent);
}

.personal-library .recent-activity,
html.light .personal-library .recent-activity,
.personal-library .recent-section-controls p {
  color: var(--library-muted);
}

.personal-library .browse-card-source {
  font-size: 12px;
}




.library-filter-help,
.library-public-status {
  margin: 4px 0 12px;
  color: var(--library-muted);
  font-size: 12px;
  line-height: 1.5;
}

.library-search-heading {
  margin: 0 0 12px;
  color: var(--library-text);
  font-size: 18px;
}

.library-public-more,
.library-public-retry {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  color: var(--library-accent);
  font-size: 14px;
}

.library-public-retry {
  padding: 8px 12px;
  border: 1px solid var(--library-border);
  border-radius: 8px;
  background: var(--library-background);
  cursor: pointer;
}

.personal-library .library-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-color: transparent;
  background: transparent;
  color: var(--library-muted);
  font-size: 12px;
}

.library-reset:hover {
  text-decoration: underline;
}

.personal-library .saved-card-actions > a,
.personal-library .saved-card-actions > .library-copy,
.personal-library .library-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  font-size: 12px;
}

.saved-card-actions .library-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.recent-notice {
  position: fixed;
  z-index: 100;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 480px;
  padding: 10px 12px;
  border: 1px solid var(--library-border);
  border-radius: 8px;
  background: var(--library-background);
  color: var(--library-text);
  box-shadow: 0 4px 20px #0003;
  font-size: 14px;
}

.recent-notice > span {
  flex: 1;
}

.personal-library .recent-notice button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--library-accent);
  font: inherit;
  cursor: pointer;
}

html.light .personal-library .saved-card-actions a,
html.light .personal-library .saved-card-actions button {
  color: var(--library-accent);
  background: var(--library-background);
}
