/* Personal Library structure and mobile filter polish */
.file-library-head,
.file-library-title,
.file-library-actions,
.file-library-body,
.file-library-recent-head,
.file-library-categories,
.file-category-chip {
  display: flex;
  align-items: center;
}

.file-library-head {
  justify-content: space-between;
}

.file-library-title {
  min-width: 0;
}

.file-library-title > div {
  min-width: 0;
}

.file-library-mark,
.file-library-stat > span,
.file-library-ext,
.file-library-empty-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.file-library-mark svg,
.file-library-stat > span svg,
.file-library-ext svg,
.file-library-empty-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.file-library-body,
.file-library-stats,
.file-library-strip {
  display: grid;
}

.file-library-file {
  display: grid;
  align-items: center;
  text-align: left;
}

.file-library-file strong,
.file-library-file small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-category-chip strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 760px) {
  .file-library-categories {
    overflow: visible !important;
    padding-bottom: 0 !important;
  }

  .file-category-chip-row {
    display: none !important;
  }

  .file-category-menu {
    position: relative;
    display: block !important;
    width: 100%;
  }

  .file-category-menu summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    border: 1px solid rgba(226, 221, 211, 0.9);
    border-radius: 14px;
    background: #ffffff;
    color: #1f2933;
    font-weight: 800;
    list-style: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(31, 41, 51, 0.035);
  }

  .file-category-menu summary::-webkit-details-marker {
    display: none;
  }

  .file-category-menu summary span {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .file-category-menu summary strong {
    color: #25677c;
    font-size: 0.95rem;
  }

  .file-category-menu-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 260px;
    overflow: auto;
    padding: 6px;
    border: 1px solid rgba(226, 221, 211, 0.95);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(31, 41, 51, 0.14);
  }

  .file-category-option {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #1f2933;
    font-weight: 800;
    cursor: pointer;
  }

  .file-category-option:hover,
  .file-category-option.active {
    background: #eef6f8;
    color: #25677c;
  }

  .file-category-option strong {
    min-width: 24px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef6f8;
    color: #2f7890;
    font-size: 0.76rem;
  }

  body.dark .file-category-menu summary {
    border-color: #26313a;
    background: #151a21;
    color: #e5e7eb;
  }

  body.dark .file-category-menu summary span {
    color: #9ca3af;
  }

  body.dark .file-category-menu summary strong {
    color: #d7f3f8;
  }

  body.dark .file-category-menu-list {
    border-color: #26313a;
    background: #151a21;
  }

  body.dark .file-category-option {
    color: #e5e7eb;
  }

  body.dark .file-category-option:hover,
  body.dark .file-category-option.active {
    background: rgba(59, 142, 165, 0.16);
    color: #d7f3f8;
  }
}
