.library {
  max-width: 1480px;
  margin: 0 auto;
  padding: 12px 24px 72px;
}
.library-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}
.library-top h1 { margin-bottom: 8px; }
.library-top .lead { margin: 0; max-width: 560px; }
.library-download {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.library-download .fine {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.library-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.library-search svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.library-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  padding: 13px 0;
  outline: none;
}
.library-search input::placeholder { color: var(--muted); }
.cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 16px 0 18px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cats button {
  flex: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.92rem;
}
.cats button[aria-pressed="true"] {
  background: #fff;
  color: #111;
}
.library-status {
  min-height: 1.2em;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}
.wp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px 16px;
}
.wp-card {
  display: grid;
  gap: 8px;
  padding: 0;
  background: transparent;
  border-radius: 16px;
  color: inherit;
  text-align: left;
  font-weight: 500;
}
.wp-card:hover { background: transparent; }
.wp-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #121214;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.wp-frame img,
.wp-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wp-frame video {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.wp-card.is-playing video { opacity: 1; }
.wp-pro {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.wp-meta { display: grid; gap: 2px; padding: 0 2px; }
.wp-title {
  font-size: 0.95rem;
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.wp-cat { color: var(--muted); font-size: 0.8rem; }
.wp-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}
.wp-dialog[hidden] { display: none; }
.wp-dialog-card {
  width: min(920px, 100%);
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 22px;
  background: #101012;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.wp-dialog-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px;
  background: #000;
}
.wp-dialog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wp-dialog-row h2 { margin: 0; font-size: 1.15rem; }
.wp-dialog-actions { display: flex; gap: 8px; flex-shrink: 0; }

@media (max-width: 800px) {
  .library { padding: 8px 16px 48px; }
  .library-top { flex-direction: column; align-items: stretch; }
  .library-download { align-items: flex-start; }
  .wp-grid { grid-template-columns: 1fr; }
  .wp-dialog-row { flex-direction: column; align-items: stretch; }
}
