/* Real library routes and themed filtering share the site's existing surfaces. */
.library-nav:not([hidden]) {
  display: flex; align-items: stretch; gap: 5px; max-width: 100%; min-height: 48px;
  padding: 0 var(--gutter); border-bottom: 1px solid var(--line); background: var(--bg2);
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
}
.library-nav a {
  position: relative; display: inline-flex; align-items: center; flex: none; gap: 6px;
  min-height: 47px; padding: 10px 14px; color: var(--tx2); font: 14px/22px var(--sans);
  text-decoration: none; white-space: nowrap;
}
.library-nav a:hover { color: var(--tx); background: var(--sf); }
.library-nav a[aria-current=page] { color: var(--ac); font-weight: 600; }
.library-nav a[aria-current=page]::after { content: ''; position: absolute; inset: auto 14px 0; height: 2px; background: var(--ac); }
.library-nav a:focus-visible { outline-offset: -4px; }
.library-nav .nav-count { color: var(--mu); font: normal 11px/1.4 var(--sans); font-variant-numeric: tabular-nums; }
.library-nav .nav-count b { font-weight: 400; }
.library-nav a[aria-current=page] .nav-count { color: var(--ac); }
html body #top #shellPage {
  position: relative; align-items: center; margin: 0; padding: 4px 0;
  border: 0; background: none; font-family: var(--sans); text-align: left; cursor: default;
}
html body #top #shellPage::before, html body #top #shellPage::after { content: none; }
.has-library-choice > svg { display: none !important; }
.library-choice-native, body.none0 [data-library-choice=sort] { display: none !important; }
.library-choice {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-width: 0; min-height: 40px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); color: var(--tx2);
  font: 14px/24px var(--sans); text-align: left; cursor: pointer;
}
.library-choice > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-choice > svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.library-choice:hover, .library-choice[aria-expanded=true] { color: var(--tx); background: var(--sf); }
.library-choice:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.pose-sort-control .library-choice { width: auto; min-height: 34px; padding: 5px 12px; font-size: 13px; }
.portrait-select .library-choice { min-height: 34px; padding: 5px 12px; border-radius: 8px; font-size: 13px; line-height: 22px; }
.portrait-select.active .library-choice { color: var(--ac); }
.scene-sort .library-choice { min-height: 40px; padding: 7px 18px 7px 22px; border: 0; border-radius: inherit; background: none; font-size: inherit; line-height: 26px; }
#libraryChoicePanel {
  position: fixed; z-index: 60; width: max-content; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border: 1px solid var(--line2); border-radius: 14px; background: var(--bg2); box-shadow: var(--sh2);
  font: 14px/22px var(--sans);
}
#libraryChoicePanel > button {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%;
  min-height: 42px; padding: 9px 12px; border: 0; border-radius: 8px; background: none;
  color: var(--tx2); font: inherit; text-align: left; overflow-wrap: anywhere;
}
#libraryChoicePanel > button:hover, #libraryChoicePanel > button:focus-visible { background: var(--sf); color: var(--tx); outline: 2px solid var(--line2); outline-offset: -2px; }
#libraryChoicePanel > button[aria-selected=true] { background: var(--acs); color: var(--ac); font-weight: 600; }
#libraryChoicePanel > button > :last-child { flex: none; visibility: hidden; }
#libraryChoicePanel > button[aria-selected=true] > :last-child { visibility: visible; }
@media(max-width:1023px) {
  .library-nav:not([hidden]) { gap: 0; padding-inline: 8px; min-height: 44px; }
  .library-nav a { min-height: 43px; padding: 8px 12px; font-size: 13px; }
}
