/* Library controls stay in place; only #sl-results is replaced. */
.starfic-library-page .header,
.starfic-library-page .header__content { height: 120px !important; }
.starfic-library-page .header__title-heading { font-size: clamp(2rem, 4vw, 3rem); }
.sl-main .main__wrapper { padding-top: 8px; }
.sl-library { --sl-muted: #aebbd0; color: #e8eef8; padding-bottom: 16px; font-size: 14px; }
html[data-mode='light'] .sl-library { --sl-muted: #526076; color: #1e293b; }
.sl-library *, .sl-library *::before, .sl-library *::after { box-sizing: border-box; }
.sl-library [hidden] { display: none !important; }
.sl-library button, .sl-library input, .sl-library select, .sl-pagination a { font: inherit; }
.sl-library button, .sl-library select, .sl-library input[type='search'] {
  border: 1px solid var(--starfic-line); border-radius: 5px; color: inherit; background: var(--starfic-panel-raised); min-height: 38px;
}
.sl-library button { cursor: pointer; padding: 6px 12px; }
.sl-library button:hover, .sl-library a:hover { color: var(--starfic-accent); border-color: var(--starfic-accent); }
.sl-library :is(a, button, input, select, summary):focus-visible { outline: 2px solid var(--starfic-accent); outline-offset: 3px; }
.sl-heading { margin-bottom: 12px; }
.sl-heading h1 { margin: 0; font: 500 25px/1.1 Georgia, serif; }
.sl-view { display: flex; gap: 4px; margin-bottom: 14px; }
.sl-view button { flex: 1; }
.sl-view button { min-height: 32px; padding: 4px 12px; font-size: 12px; }
.sl-view [aria-pressed='true'], .sl-pagination [aria-current] { background: var(--starfic-accent); color: #07101c; border-color: var(--starfic-accent); }
html[data-mode='light'] .sl-view [aria-pressed='true'],
html[data-mode='light'] .sl-pagination [aria-current] { color: #fff; }
.sl-toolbar { display: grid; gap: 10px; margin-bottom: 10px; }
.sl-search { position: relative; }
.sl-search input { width: 100%; min-width: 0; padding: 8px 35px 8px 9px; font-size: 12px; }
.sl-search button { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 32px; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--starfic-accent); }
.sl-search button:hover { background: rgba(var(--starfic-accent-rgb), .12); }
.sl-sort { display: grid; gap: 5px; font-size: 12px; color: var(--sl-muted); }
.sl-sort select { width: 100%; }
.sl-library select { padding: 6px 30px 6px 10px; max-width: 100%; color-scheme: dark; }
html[data-mode='light'] .sl-library select { color-scheme: light; }
.sl-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.sl-rail { min-width: 0; border-right: 1px solid var(--starfic-line); padding-right: 16px; }
.sl-controls > summary { display: none; }
.sl-filters { min-width: 0; }
.sl-filters > summary { cursor: pointer; font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.sl-filter-number { color: var(--starfic-accent); margin-left: 4px; font-variant-numeric: tabular-nums; }
.sl-library fieldset { margin: 0 0 15px; padding: 0; border: 0; min-width: 0; }
.sl-library legend, .sl-field { font-size: 12px; font-weight: 600; color: var(--sl-muted); }
.sl-library legend { margin: 0 0 6px; }
.sl-check { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; line-height: 1.3; }
.sl-check:hover { color: var(--starfic-accent); }
.sl-check input { width: 15px; height: 15px; flex: 0 0 15px; accent-color: var(--starfic-accent); margin: 0; appearance: auto; }
.sl-check small { margin-left: auto; color: var(--sl-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.sl-field { display: grid; gap: 5px; margin-bottom: 12px; }
.sl-field select { width: 100%; font-size: 12px; font-weight: 400; color: inherit; }
.sl-tag-browser { border-top: 1px solid var(--starfic-line); padding-top: 13px; margin-top: 16px; }
.sl-tag-browser h2 { font-size: 14px; margin: 0 0 9px; }
.sl-tag-browser input[type='search'] { width: 100%; min-width: 0; padding: 6px 9px; font-size: 12px; margin-bottom: 10px; }
.sl-tag-browser .sl-term { font-size: 12px; }
.sl-match { grid-template-columns: auto 1fr; align-items: center; }
.sl-match select { padding-left: 5px; font-size: 11px; }
.sl-reset { width: 100%; font-size: 12px !important; margin-bottom: 12px; }
.sl-content { min-width: 0; }
.sl-active { display: flex; flex-wrap: wrap; gap: 5px; }
.sl-active:not(:empty) { margin-bottom: 10px; }
.sl-active button { min-height: 28px; padding: 3px 8px; color: var(--starfic-accent); font-size: 12px; }
.sl-feedback { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sl-error { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 12px; border: 1px solid #dca86d; }
.sl-results-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; color: var(--sl-muted); font-size: 12px; }
.sl-count { margin: 0; font-variant-numeric: tabular-nums; }
.sl-pagination { display: flex; align-items: center; gap: 3px; }
.sl-pagination :is(a, span) { display: grid; min-width: 29px; min-height: 32px; padding: 4px 7px; place-items: center; border: 1px solid var(--starfic-line); border-radius: 4px; text-decoration: none; font-variant-numeric: tabular-nums; }
.sl-pagination span { border-color: transparent; }
.sl-pagination [aria-disabled] { opacity: .45; }
.sl-pagination .sl-ellipsis { min-width: 10px; padding: 0; }
#sl-results { scroll-margin-top: 76px; }
#sl-results[aria-busy='true'] { cursor: progress; }
#sl-results[aria-busy='true'] .sl-count::after { content: ' · Updating…'; color: var(--starfic-accent); }
.sl-stories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sl-story { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: start; padding: 13px; background: var(--starfic-panel); border: 1px solid var(--starfic-line); border-radius: 6px; min-width: 0; }
.sl-story:hover, .sl-story:focus-within { border-color: rgba(var(--starfic-accent-rgb), .6); }
.sl-cover { display: grid; place-items: center; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 3px; background: rgba(var(--starfic-accent-rgb), .06); color: var(--starfic-accent); }
.sl-cover img { width: 100%; height: 100%; object-fit: cover; }
.sl-story h2 { margin: 0 0 6px; font-size: 16px; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.sl-story h2 a { color: inherit; text-decoration: none; }
.sl-meta { display: flex; flex-wrap: wrap; column-gap: 9px; row-gap: 3px; margin-bottom: 7px; font-size: 11px; line-height: 1.3; color: var(--sl-muted); }
.sl-meta .sl-status { color: var(--starfic-accent); }
.sl-meta .starfic-audio-card { font-weight: 700; }
.sl-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 0 0 9px; font-size: 12px; line-height: 1.5; }
.sl-story-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.sl-story-tags .sl-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 6px; border: 1px solid var(--starfic-line); border-radius: 3px; font-size: 11px; line-height: 1.4; text-decoration: none; color: var(--sl-muted); }
.sl-story-tags .sl-fandom { color: var(--starfic-accent); }
.sl-story-tags .sl-warning { border-style: dashed; }
.sl-date { color: var(--sl-muted); font-size: 10px; margin-top: 9px; }
.sl-results-bottom { margin: 16px 0 0; }
.sl-library[data-view='list'] .sl-stories { grid-template-columns: 1fr; }
.sl-library[data-view='list'] .sl-story { grid-template-columns: 45px minmax(0, 1fr); padding: 10px 12px; }
.sl-library[data-view='list'] .sl-description { -webkit-line-clamp: 1; }
.sl-library[data-view='list'] .sl-story-tags { display: inline-flex; }
.sl-library[data-view='list'] .sl-date { display: inline-block; margin: 4px 0 0 8px; }
.sl-empty { padding: 30px 16px; border: 1px solid var(--starfic-line); border-radius: 6px; }
.sl-empty h2 { font-size: 18px; margin: 0 0 16px; }
.sl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.no-js .sl-view, .no-js .sl-reset, .no-js #sl-tag-search { display: none; }
html[data-mode='light'] .starfic-library-page .main-navigation__right :is(a, button) { color: #dce5f4; }
@media (max-width: 1050px) {
  .sl-stories { grid-template-columns: 1fr; }
  .sl-story { grid-template-columns: 68px minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .starfic-library-page .header, .starfic-library-page .header__content { height: 95px !important; }
  .sl-main .main__wrapper { padding-top: 6px; }
  .sl-layout { grid-template-columns: 1fr; gap: 6px; }
  .sl-rail { padding: 0; border: 0; border-bottom: 1px solid var(--starfic-line); }
  .sl-controls > summary { display: list-item; min-height: 36px; padding-block: 8px; cursor: pointer; font-weight: 600; }
  .sl-rail-body { padding-block: 8px; }
  .sl-heading { display: none; }
  .sl-filters { padding: 0; border: 0; }
  .sl-filters > summary { min-height: 34px; margin-bottom: 0; }
  .sl-filter-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; padding: 10px 0; }
  .sl-filter-body > fieldset, .sl-tag-browser, .sl-reset { grid-column: 1 / -1; }
  .sl-filter-body > fieldset { display: flex; gap: 18px; }
  .sl-filter-body > fieldset legend { margin-bottom: 5px; }
  .sl-check { min-height: 36px; }
  .sl-tag-browser { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .sl-tag-browser h2, .sl-tag-browser > input, .sl-tag-browser .sl-match { grid-column: 1 / -1; }
  .sl-story { padding: 11px; gap: 10px; grid-template-columns: 54px minmax(0, 1fr); }
  .sl-story h2 { font-size: 15px; }
  .sl-pagination :is(a, span) { min-height: 36px; padding-inline: 7px; }
  .sl-results-bar { gap: 9px; }
}
