/* PersonaScope 5.0 Phase 2 v509: library filters without horizontal scrolling */
.library-category-picker {
  margin-top: 16px;
  border: 1px solid rgba(151, 208, 255, .18);
  border-radius: 18px;
  background: rgba(5, 17, 34, .52);
  overflow: hidden;
}
.library-category-picker > summary {
  min-height: 68px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.library-category-picker > summary::-webkit-details-marker { display: none; }
.library-category-picker > summary::after {
  content: "⌄";
  flex: 0 0 auto;
  color: #8ee8ef;
  font-size: 1.35rem;
  line-height: 1;
  transition: transform .2s ease;
}
.library-category-picker[open] > summary::after { transform: rotate(180deg); }
.library-category-picker-label {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.library-category-picker-label small,
.library-filter-label {
  color: #91a5c3;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.library-category-picker-label b {
  min-width: 0;
  color: #f4f8ff;
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.library-category-picker-action {
  margin-left: auto;
  color: #8ee8ef;
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
}
.library-category-picker[open] .library-category-picker-action { color: #b4c6dd; }

.library-category-row {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px !important;
  overflow: visible !important;
  padding: 0 12px 13px !important;
  scrollbar-width: auto !important;
}
.library-category-row::-webkit-scrollbar { display: none; }
.library-category-row .library-chip {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 10px 11px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  border-radius: 14px !important;
  white-space: normal !important;
  text-align: left;
  line-height: 1.28;
  overflow-wrap: anywhere;
}
.library-category-row .library-chip:first-child { grid-column: 1 / -1; }
.library-category-row .library-chip small {
  flex: 0 0 auto;
  margin-left: 0;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-size: .7rem;
}
.library-category-row .library-chip.active small { background: rgba(5, 17, 31, .14); }

.library-view-block {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.library-view-row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px !important;
  overflow: visible !important;
  padding: 0 !important;
}
.library-view-row .library-toggle {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.2;
}

@media (max-width: 360px) {
  .library-category-row { grid-template-columns: 1fr; }
  .library-category-row .library-chip:first-child { grid-column: auto; }
  .library-view-row .library-toggle { font-size: .82rem; }
}
