.prompt-library {
  --pl-ink: #172e4c;
  --pl-muted: #526985;
  --pl-line: #dce6f2;
  --pl-blue: #1555c0;
  max-width: 1240px;
  margin: 0 auto;
  padding-bottom: 48px;
  color: var(--pl-ink);
}
.prompt-library :focus-visible {
  outline: 3px solid #448cff;
  outline-offset: 3px;
}
.pl-visually-hidden, .pl-filter-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.prompt-library .pl-hero {
  padding: clamp(25px, 4vw, 52px);
  border-radius: 24px;
  background: radial-gradient(ellipse at 5% 0%, #285fac 0%, transparent 55%), #122c50;
  color: #fff;
}
.pl-hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 850;
  line-height: 1.4;
}
.pl-hero p {
  margin: 8px 0 22px;
  color: #dde9fa;
  font-size: 14px;
  line-height: 1.9;
}
.pl-search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 630px;
  padding: 5px 14px 5px 5px;
  border: 1px solid #fff;
  border-radius: 12px;
  background: #fff;
  color: var(--pl-ink);
}
.pl-search > .icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--pl-blue);
}
.prompt-library .pl-search input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: #fff;
  color: var(--pl-ink);
  font-size: 14px;
  text-align: start;
}
.pl-search button, .pl-filter-submit, .pl-empty a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--pl-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}
.pl-search button:hover, .pl-filter-submit:hover, .pl-empty a:hover {
  background: #1047a6;
  color: #fff;
}

.pl-market {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  margin-top: 25px;
}
.pl-sidebar {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--pl-line);
  border-radius: 15px;
  background: #fff;
}
.pl-filter-toggle, .pl-mobile-filter-toggle { display: none; }
.pl-sidebar-head, .pl-range-heading, .pl-results-head, .pl-card-top, .pl-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pl-sidebar-head {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--pl-line);
}
.pl-sidebar-head h2 { font-size: 17px; font-weight: 800; }
.pl-sidebar-head a, .pl-active-filters a { color: var(--pl-blue); font-size: 12px; font-weight: 750; }
.pl-filter-group {
  min-width: 0;
  margin: 0 0 13px;
  padding: 0 0 13px;
  border: 0;
  border-bottom: 1px solid #eaf0f7;
}
.pl-filter-group legend, .pl-filter-group > label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 750;
}
.prompt-library .pl-filter-group input[type=search],
.prompt-library .pl-filter-group select,
.prompt-library .pl-price-range input {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--pl-line);
  border-radius: 8px;
  background: #f8faff;
  color: var(--pl-ink);
  font-size: 12px;
}
.pl-category-search { margin-bottom: 5px; }
.pl-category-options { max-height: 195px; overflow-y: auto; scrollbar-width: thin; }
.pl-filter-group .pl-filter-choice {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 33px;
  margin: 0;
  padding: 4px 6px;
  border-radius: 7px;
  color: var(--pl-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.pl-filter-group .pl-filter-choice[hidden] { display: none; }
.pl-filter-choice:hover { background: #f5f8fd; }
.pl-filter-choice:has(input:checked) { background: #ebf3ff; color: #154f9f; font-weight: 750; }
.pl-filter-choice input { accent-color: var(--pl-blue); flex: none; }
.pl-filter-choice span { flex: 1; }
.pl-filter-choice small { min-width: 20px; text-align: center; font-size: 11px; }
.pl-category-empty, .pl-range-help { margin: 6px 0 0; color: var(--pl-muted); font-size: 11px; }
.pl-range-heading { margin-bottom: 7px; font-size: 13px; }
.pl-range-heading span { color: var(--pl-muted); font-size: 11px; }
.pl-price-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pl-price-range label { min-width: 0; color: var(--pl-muted); font-size: 11px; }
.prompt-library .pl-price-range input { display: block; margin-top: 4px; }
.pl-filter-submit { width: 100%; }
.pl-filter-submit .icon { width: 15px; height: 15px; }
.pl-filter-error { margin: 7px 0; color: #a7253b; font-size: 12px; }

.pl-results { min-width: 0; }
.pl-results-head { margin-bottom: 13px; }
.pl-results-head h2 { font-size: clamp(19px, 2.6vw, 27px); font-weight: 800; overflow-wrap: anywhere; }
.pl-results-count { flex: none; color: var(--pl-muted); font-size: 12px; }
.pl-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--pl-muted);
  font-size: 12px;
}
.pl-active-filters b { padding: 4px 8px; border-radius: 6px; background: #eaf2ff; color: #174b94; }
.pl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pl-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--pl-line);
  border-radius: 16px;
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
}
.pl-card:hover, .pl-card:focus-within { border-color: #a8c5ee; box-shadow: 0 8px 22px #193d6b0e; }
.pl-card-category, .pl-price {
  padding: 4px 8px;
  border-radius: 6px;
  background: #edf3fc;
  color: #234b83;
  font-size: 11px;
  font-weight: 750;
}
.pl-price { flex: none; background: #f0f4fb; color: #203d65; font-size: 12px; }
.pl-price.is-free { background: #e9f7ef; color: #176346; }
.pl-card h3 { font-size: 18px; line-height: 1.6; font-weight: 800; overflow-wrap: anywhere; }
.pl-card h3 a:hover { color: var(--pl-blue); }
.pl-card-description { color: var(--pl-muted); font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.pl-preview { padding: 9px 11px; border-inline-start: 2px solid #8cb6f0; border-radius: 7px; background: #f5f8fd; }
.pl-preview > span { color: #2c5486; font-size: 11px; font-weight: 750; }
.pl-preview p { margin-top: 3px; color: #435c7a; font-size: 12px; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.pl-card-bottom { margin-top: auto; padding-top: 9px; flex-wrap: wrap; }
.pl-card-bottom > span { color: var(--pl-muted); font-size: 11px; }
.pl-card-bottom a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin-inline-start: auto;
  padding: 6px 9px;
  border-radius: 7px;
  background: #edf4ff;
  color: var(--pl-blue);
  font-size: 12px;
  font-weight: 750;
}
.pl-card-bottom a:hover { background: #dceaff; }
.pl-card-bottom .icon { width: 14px; height: 14px; }
.pl-empty { grid-column: 1/-1; padding: 36px 16px; border: 1px dashed #b8cbe4; border-radius: 14px; background: #fff; text-align: center; }
.pl-empty > span { display: inline-flex; color: var(--pl-blue); }
.pl-empty h3 { margin-top: 7px; font-size: 18px; }
.pl-empty p { margin: 6px 0 14px; color: var(--pl-muted); font-size: 13px; }
.pl-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; color: var(--pl-muted); font-size: 13px; }
.pl-pagination a { padding: 8px 12px; border: 1px solid var(--pl-line); border-radius: 8px; background: #fff; color: var(--pl-blue); }

@media (max-width: 1030px) {
  .pl-market { grid-template-columns: 208px minmax(0, 1fr); gap: 15px; }
}
@media (max-width: 850px) {
  .pl-market { grid-template-columns: minmax(0, 1fr); margin-top: 15px; }
  .pl-sidebar { padding: 0; }
  .pl-filter-toggle { display: block; }
  .pl-mobile-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 10px 13px;
    border-radius: 14px;
    color: var(--pl-ink);
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
  }
  .pl-mobile-filter-toggle .icon { width: 16px; height: 16px; color: var(--pl-blue); }
  .pl-filter-toggle:focus-visible + label { outline: 3px solid #448cff; outline-offset: 3px; }
  .pl-filter-toggle:checked + label .icon { transform: rotate(180deg); }
  .pl-sidebar form { display: none; padding: 12px 14px 14px; border-top: 1px solid var(--pl-line); }
  .pl-filter-toggle:checked ~ form { display: block; }
}
@media (max-width: 550px) {
  .prompt-library .pl-hero { padding: 21px 16px; border-radius: 16px; }
  .pl-hero p { margin-bottom: 16px; font-size: 13px; }
  .pl-search { gap: 6px; padding-inline-start: 8px; }
  .pl-search > .icon { width: 16px; height: 16px; }
  .prompt-library .pl-search input { font-size: 12px; }
  .pl-search button { padding-inline: 9px; }
  .pl-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pl-card { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .pl-card { transition: none; }
}

.pl-hero-submit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: #e0edff;
  font-size: 13px;
  font-weight: 750;
}
.pl-hero-submit:hover { color: #fff; text-decoration: underline; }
.pl-hero-submit .icon { width: 15px; height: 15px; }
.pl-card .pl-card-image { margin: 0; border-radius: 9px; }
.pl-card .pm-tags { margin: 0; gap: 5px; }
.pl-card .pm-tags a { padding: 3px 8px; font-size: 11px; }
