.ps-bundle-library {
  --ps-library-text: #172033;
  --ps-library-muted: #526178;
  --ps-library-border: #d7dfeb;
  --ps-library-panel: #ffffff;
  --ps-library-soft: #f5f8fc;
  --ps-library-gold: #e6a000;
  --ps-review: #df7400;
  --ps-explanation: #3b82f6;
  --ps-practice: #22b95d;
  --ps-quiz: #8754ed;
  --ps-exam: #ef4444;

  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  color: var(--ps-library-text);
}

.ps-library-controls {
  padding: 24px;
  border: 1px solid var(--ps-library-border);
  border-radius: 18px;
  background: var(--ps-library-panel);
  box-shadow: 0 14px 35px rgba(28, 42, 66, 0.07);
}

.ps-library-search-wrap label,
.ps-library-filter label {
  display: block;
  margin-bottom: 7px;
  color: var(--ps-library-text);
  font-size: 14px;
  font-weight: 700;
}

.ps-library-search-field { position: relative; }

.ps-library-search-field svg {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 20px;
  height: 20px;
  color: var(--ps-library-gold);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.ps-library-search-field input {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px 12px 47px;
  border: 1px solid var(--ps-library-border);
  border-radius: 11px;
  background: #fff;
  color: var(--ps-library-text);
  font: inherit;
  font-size: 16px;
  outline: none;
}

.ps-library-search-field input:focus {
  border-color: var(--ps-library-gold);
  box-shadow: 0 0 0 3px rgba(230, 160, 0, 0.13);
}

.ps-library-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.ps-library-filter select,
.ps-library-filter button {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--ps-library-border);
  border-radius: 9px;
  background: #fff;
  color: var(--ps-library-text);
  font: inherit;
  font-size: 14px;
}

.ps-library-filter select { cursor: pointer; }

.ps-library-filter button {
  background: var(--ps-library-soft);
  font-weight: 700;
  cursor: pointer;
}

.ps-library-filter button:hover,
.ps-library-filter button:focus-visible {
  border-color: var(--ps-library-gold);
  background: rgba(230, 160, 0, 0.09);
}

.ps-library-blank-label {
  display: block;
  margin-bottom: 7px;
  visibility: hidden;
  font-size: 14px;
}

.ps-library-status {
  min-height: 30px;
  margin: 22px 2px 8px;
  color: var(--ps-library-muted);
  font-size: 14px;
}

.ps-bundle-results {
  display: grid;
  gap: 16px;
}

.ps-bundle-card {
  overflow: hidden;
  border: 1px solid var(--ps-library-border);
  border-left: 5px solid var(--ps-review);
  border-radius: 15px;
  background: var(--ps-library-panel);
  box-shadow: 0 8px 24px rgba(28, 42, 66, 0.055);
}

.ps-bundle-card-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 21px 22px;
}

.ps-bundle-card-content { min-width: 0; }

.ps-bundle-eyebrow {
  margin-bottom: 5px;
  color: var(--ps-review);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ps-bundle-card h2 {
  margin: 0;
  color: var(--ps-library-text);
  font-size: 20px;
  line-height: 1.25;
}

.ps-bundle-card-description {
  margin: 7px 0 0;
  color: var(--ps-library-muted);
  font-size: 14px;
  line-height: 1.55;
}

.ps-bundle-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  max-width: 520px;
}

.ps-bundle-link {
  display: inline-flex;
  min-height: 41px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border: 1px solid rgba(223, 116, 0, 0.32);
  border-radius: 999px;
  background: rgba(223, 116, 0, 0.09);
  color: #a45100;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.ps-bundle-link:hover,
.ps-bundle-link:focus-visible {
  border-color: var(--ps-review);
  background: rgba(223, 116, 0, 0.16);
  color: #7c3d00;
  text-decoration: none;
  transform: translateY(-1px);
}

.ps-bundle-link-time {
  font-weight: 600;
  opacity: 0.82;
}


.ps-library-no-results {
  margin-top: 18px;
  padding: 34px 22px;
  border: 1px dashed var(--ps-library-border);
  border-radius: 15px;
  background: var(--ps-library-panel);
  text-align: center;
}

.ps-no-results-icon {
  display: flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  border: 2px solid var(--ps-library-gold);
  border-radius: 50%;
  color: var(--ps-library-gold);
  font-size: 24px;
  font-weight: 800;
}

.ps-library-no-results h2 {
  margin: 0 0 7px;
  font-size: 21px;
}

.ps-library-no-results p {
  margin: 0 auto 17px;
  color: var(--ps-library-muted);
}

.ps-library-no-results button {
  min-height: 42px;
  padding: 9px 17px;
  border: 0;
  border-radius: 999px;
  background: var(--ps-library-gold);
  color: #172033;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* Dark mode */
.ps-dark-mode .ps-bundle-library {
  --ps-library-text: #eef3fb;
  --ps-library-muted: #b2bfd2;
  --ps-library-border: #3a475c;
  --ps-library-panel: #172033;
  --ps-library-soft: #202b3d;
}

.ps-dark-mode .ps-library-search-field input,
.ps-dark-mode .ps-library-filter select,
.ps-dark-mode .ps-library-filter button {
  background: #111827;
  color: var(--ps-library-text);
}

.ps-dark-mode .ps-bundle-link {
  color: #ffb86b;
  background: rgba(223, 116, 0, 0.16);
}


/* Responsive */
@media (max-width: 800px) {
  .ps-library-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ps-bundle-card-inner {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .ps-bundle-buttons {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .ps-library-controls {
    padding: 18px;
  }

  .ps-library-filter-grid {
    grid-template-columns: 1fr;
  }

  .ps-library-blank-label {
    display: none;
  }

  .ps-bundle-card-inner {
    padding: 18px;
  }

  .ps-bundle-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ps-bundle-link {
    width: 100%;
  }
}


/* =========================================================
   v1.1.0 — Student-first compact depth → treatment chooser
   ========================================================= */

.ps-bundle-card-inner {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  align-items: start;
}

.ps-bundle-buttons {
  display: block;
  max-width: 460px;
  width: 100%;
}

.ps-depth-options {
  display: grid;
  gap: 10px;
}

.ps-depth-option {
  width: 100%;
}

.ps-depth-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
  border: 1px solid rgba(223, 116, 0, 0.32);
  border-radius: 999px;
  background: rgba(223, 116, 0, 0.09);
  color: #a45100;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.ps-depth-button:hover,
.ps-depth-button:focus-visible {
  border-color: var(--ps-review);
  background: rgba(223, 116, 0, 0.16);
  transform: translateY(-1px);
}

.ps-depth-button[aria-expanded="true"] {
  border-color: var(--ps-review);
  background: rgba(223, 116, 0, 0.16);
}

.ps-depth-name {
  font-size: 14px;
  font-weight: 800;
}

.ps-depth-time {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.82;
  white-space: nowrap;
}

.ps-treatment-panel {
  margin: 9px 4px 3px;
  padding: 12px;
  border: 1px solid var(--ps-library-border);
  border-radius: 12px;
  background: var(--ps-library-soft);
}

.ps-treatment-panel[hidden] {
  display: none !important;
}

.ps-treatment-label {
  margin-bottom: 9px;
  color: var(--ps-library-muted);
  font-size: 12px;
  font-weight: 700;
}

.ps-treatment-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.ps-treatment-link {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--ps-library-border);
  border-radius: 9px;
  background: var(--ps-library-panel);
  color: var(--ps-library-text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
}

.ps-treatment-link:hover,
.ps-treatment-link:focus-visible {
  border-color: var(--ps-review);
}


.ps-dark-mode .ps-depth-button {
  color: #ffb86b;
  background: rgba(223, 116, 0, 0.16);
}

.ps-dark-mode .ps-treatment-panel {
  background: #111827;
}

@media (max-width: 800px) {
  .ps-bundle-card-inner {
    grid-template-columns: 1fr;
  }

  .ps-bundle-buttons {
    max-width: none;
  }
}

@media (max-width: 520px) {
  .ps-depth-button {
    min-height: 46px;
    padding: 10px 13px;
  }

  .ps-treatment-panel {
    margin-left: 0;
    margin-right: 0;
  }
}


/* =========================================================
   v1.2.0 — Compact scalable library
   ========================================================= */

.ps-bundle-card-description {
  display: none;
}

.ps-bundle-card-inner {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  align-items: center;
  padding: 18px 22px;
}

.ps-bundle-card h2 {
  font-size: 19px;
}

.ps-library-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.ps-library-more {
  min-width: 170px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--ps-library-border);
  border-radius: 999px;
  background: var(--ps-library-soft);
  color: var(--ps-library-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ps-library-more:hover,
.ps-library-more:focus-visible {
  border-color: var(--ps-library-gold);
  background: rgba(230, 160, 0, 0.09);
}

@media (max-width: 800px) {
  .ps-bundle-card-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }
}
