/* Loaded after the sidebar, theme and mobile rules. Native details owns disclosure state. */
#documents-panel #paper-library > .paper-library-summary {
  display: flex;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--ui-text);
  font-size: var(--ui-font-heading);
  font-weight: 600;
}

#documents-panel .paper-library-actions {
  align-items: center;
  gap: 4px;
  padding: 0 12px 8px;
}

#documents-panel .paper-library-actions .button,
#documents-panel .translation-library-open {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  height: auto;
  padding: 8px;
  gap: 8px;
  border-radius: 6px;
  line-height: 20px;
  box-shadow: none;
}

#documents-panel .paper-library-actions .button > svg {
  width: 18px;
  height: 18px;
}

#documents-panel .translation-library-nav {
  min-width: 0;
  margin: 0 0 0 auto;
  padding: 0;
}

#documents-panel .translation-library-open {
  width: auto;
  color: var(--ui-text-soft);
}

#documents-panel .translation-library-open:is(:hover, [aria-expanded="true"]) {
  color: var(--ui-primary);
}

#documents-panel #project-library {
  margin-top: 0;
}

#documents-panel #project-library > summary {
  color: var(--ui-text-soft);
  font-size: var(--ui-font-body);
}

#documents-panel > #library-trash {
  margin: 8px 0 0;
  border-top: 1px solid var(--ui-border);
}

#documents-panel #library-trash > summary {
  justify-content: flex-start;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--ui-text-soft);
  font-size: 13px;
  font-weight: 400;
}

/* Keep the reading-only group out of data mode after its static move. */
#reading-sidebar[hidden] ~ #library-trash {
  display: none;
}

#library-trash :is(.library-trash-help, .library-trash-status, .library-trash-empty) {
  margin: 0;
  padding: 0 12px 8px;
  overflow-wrap: anywhere;
  font-size: var(--ui-font-metadata);
  line-height: 1.5;
}

#library-trash .library-trash-item {
  padding: 8px 12px;
  border-inline: 0;
}

#library-trash .document-name {
  font-size: 13px;
  font-weight: 400;
}

#library-trash .document-meta {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: var(--ui-font-metadata);
  line-height: 1.5;
}

#library-trash .library-trash-actions {
  align-items: flex-start;
  gap: 4px;
  margin-top: 4px;
}

#library-trash :is(.button, .status-retry) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  padding: 8px;
  gap: 8px;
  border-radius: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 20px;
  text-align: start;
}

#library-trash .button > svg {
  flex: none;
  width: 18px;
  height: 18px;
}

#documents-panel :is(#paper-library, #project-library, #library-trash) > summary:focus-visible,
#documents-panel .paper-library-actions :is(button, a):focus-visible,
#library-trash :is(button, a):focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: -2px;
}

@media (min-width: 821px) and (max-width: 1100px) {
  #documents-panel .translation-library-open > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
