/* QPal Content Library Groups — compact inter-group spacing.
   The Shared Library list already provides its standard row gap, so group
   sections must not add a second vertical margin on top of it. */

.qpal-shared-library-group + .qpal-shared-library-group {
  margin-top: 0;
}

/*
   New-item status uses the same compact visual language as the numeric
   badges on the Set A / Set B / Set C / Flashcards tabs.
*/
.qpal-shared-library-item.is-new {
  position: relative !important;
  overflow: visible !important;
}

/* Responsive item-copy rules may establish their own positioning context.
   Keep the badge anchored to the complete subject/deck card instead. */
.qpal-shared-library-item.is-new > .qpal-shared-library-item-copy {
  position: static !important;
}

.qpal-shared-library-item.is-new .qpal-shared-library-new-label {
  position: absolute !important;
  top: -7px !important;
  right: -7px !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 4;
  display: grid !important;
  place-items: center;
  width: auto !important;
  min-width: 17px !important;
  height: 17px !important;
  min-height: 17px !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 4px !important;
  box-sizing: border-box;
  overflow: hidden;
  border: 2px solid var(--surface) !important;
  border-radius: 999px !important;
  background: #dc2626 !important;
  color: transparent !important;
  font-family: "Geist Pixel", monospace !important;
  font-size: 0 !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

html:not(.dark-mode) .qpal-shared-library-item.is-new .qpal-shared-library-new-label {
  border-color: #fff !important;
}

/* Preserve the existing semantic NEW SUBJECT / NEW DECK text in the DOM,
   while presenting one compact visual NEW badge. */
.qpal-shared-library-item.is-new .qpal-shared-library-new-label::after {
  content: "NEW";
  display: block;
  color: #fff !important;
  font-family: "Geist Pixel", monospace !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}

@media (max-width: 620px) {
  .qpal-shared-library-item.is-new .qpal-shared-library-new-label {
    top: -7px !important;
    right: -7px !important;
    min-width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    padding: 0 4px !important;
  }

  .qpal-shared-library-item.is-new .qpal-shared-library-new-label::after {
    font-size: 8px !important;
  }
}
