/* Vue « bibliothèque » (#/). Les composants partagés (.topbar, .btn, .fab, .chip…) viennent de base.css. */

.library-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  /* marge basse : le bouton flottant « Scanner » ne doit jamais masquer le dernier document */
  padding: 6px 0 calc(92px + var(--safe-b));
}

.library-loading {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 24px;
  color: var(--text-dim);
  font-size: 15px;
}

.library-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px calc(8px + var(--safe-r)) 4px calc(8px + var(--safe-l));
  margin: 0;
}

.library-item {
  display: flex;
  align-items: center;
  gap: 2px;
}

.library-item__main {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: var(--tap);
  padding: 10px 8px;
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: background-color .15s var(--ease);
}

.library-item__main:active {
  background: var(--surface-2);
}

.library-item__thumb {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 70px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-dim);
}

.library-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-item__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.library-item__title {
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.library-item__meta {
  font-size: 13px;
  color: var(--text-dim);
}

/* ------------------------------------------------------- feuille « Réglages » */

.library-settings {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 4px 0 6px;
}

.library-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.library-section__title {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.library-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.library-value {
  font-size: 15px;
  color: var(--text-dim);
  word-break: break-word;   /* repli iOS < 15.4 (sans overflow-wrap: anywhere) */
  overflow-wrap: anywhere;
}

.library-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-dim);
}

.library-note .icon {
  margin-top: 2px;
  color: var(--accent);
}

.library-version {
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------------------------------------------------- feuille « Fichier prêt » */

.library-files {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 6px;
}

.library-files__name {
  font-size: 15px;
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Deux boutons côte à côte s'ils tiennent, sinon empilés (« Télécharger » déborderait sous ~360 px). */
.library-files__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.library-files__actions .btn {
  flex: 1 1 160px;
  min-width: 0;
}

.library-hint {
  font-size: 13px;
  color: var(--text-dim);
}

/* Écrans larges : la liste reste lisible et centrée. */
@media (min-width: 720px) {
  .library-list {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
  }
}
