/* PACK LIBRARY page (Oct 19 2026, static/packlib.js) — every rule under .pl- ; colours only through tokens.css variables, so both
   themes work. It stands on the studio's own pieces (.card, .btn, .badge, .tabs .tab, .input, .tip, .dialog) and only adds layout.
   Nothing scrolls the page sideways at phone width: long ad names are cut with … and keep their whole name in the hover hint. */
.pl-page { min-width: 0; }
.pl-h { margin: 0 0 4px; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.pl-lead { margin: 0 0 12px; max-width: 64ch; }
.pl-sub { margin: 14px 0 6px; font-size: 16px; }
.pl-tabs { margin-bottom: 12px; }
.pl-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pl-q { width: 100%; max-width: 640px; }
.pl-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 10px 0 6px; min-width: 0; }
.pl-f { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 0 1 180px; }
.pl-f .lbl { font-size: 12px; color: var(--text-muted); }
.pl-f select.input { width: 100%; min-height: 36px; font-size: 13px; }
.pl-hid { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text); flex: 0 0 auto; min-height: 36px; }
.pl-count { min-height: 18px; margin: 4px 0 8px; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; min-width: 0; }
.pl-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; min-width: 0; margin: 0; }
.pl-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: var(--radius-small); overflow: hidden; width: 100%; }
.pl-thumbs img, .pl-thumbs i { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-subtle); border-radius: 4px; }
.pl-thumbs:focus-visible { outline: none; box-shadow: var(--glow-focus); }
.pl-nothumbs { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; background: var(--surface-subtle); cursor: pointer; color: var(--text); }
.pl-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pl-name { display: block; margin: 0; font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pl-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.pl-kind { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-line, .pl-from { overflow-wrap: anywhere; }
.pl-from { font-size: 12px; }
.pl-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; min-width: 0; }
.pl-acts .btn { max-width: 100%; }
.pl-older-t { align-self: flex-start; margin-top: 6px; }
.pl-olds { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--border); }
.pl-old { padding: 8px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.pl-empty { padding: 24px 8px; text-align: center; color: var(--text-muted); }
.pl-empty p { margin: 0 0 10px; }
.pl-err { color: var(--danger); }
.pl-more { display: flex; justify-content: center; padding: 16px 0 4px; min-height: 8px; }
.pl-dls { list-style: none; margin: 0; padding: 0; }
.pl-dl { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.pl-dl .pl-name { flex: 1 1 200px; }
.pl-dl-when { flex: 0 0 auto; }
.dialog.pl-dialog { width: min(calc(100vw - 32px), 900px); }
.pl-detail { min-width: 0; }
.pl-detail .pl-name { font-size: 16px; }
.pl-brief { margin-top: 2px; }
.pl-sheets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); gap: 10px; }
.pl-sheet { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-small);
  background: var(--surface); color: var(--text); cursor: zoom-in; overflow: hidden; text-align: left; min-width: 0; }
.pl-sheet img, .pl-sheet i { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-subtle); }
.pl-sheet:hover { border-color: var(--brand-cyan); }
.pl-sheet:focus-visible { outline: none; box-shadow: var(--glow-focus); }
.pl-sheet-n { display: block; padding: 0 6px 6px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-big { margin: 10px 0 0; text-align: center; }
.pl-big img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--radius-small); background: var(--surface-subtle); }
.pl-detail-acts { margin-top: 14px; }
@media (max-width: 640px) {
  .pl-f { flex: 1 1 calc(50% - 6px); }
  .pl-hid { flex: 1 1 100%; }
  .pl-acts .btn { flex: 1 1 auto; }
}
