/* V10 — densité portrait corrigée sans modifier le rendu ordinateur/paysage. */

.library-card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.library-card-actions button { white-space: nowrap; }

.library-preview-button {
  background: transparent;
  border: 1px solid rgba(242, 184, 75, .45);
  color: var(--gold);
}

.book-preview-viewer {
  align-self: flex-start;
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 920px;
  padding: 4px;
  width: 100%;
}

.book-preview-page {
  background: #111117;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 10px;
}

.book-preview-page img {
  background: #fff;
  height: auto;
  max-height: none;
  width: 100%;
}

.book-preview-page figcaption {
  color: var(--muted);
  font-size: .72rem;
  text-align: center;
}

.preview-message {
  align-self: center;
  color: var(--muted);
  line-height: 1.55;
  margin: auto;
  max-width: 620px;
  padding: 24px;
  text-align: center;
}

.home-statistics-title {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.home-statistics-title .secondary {
  flex: 0 0 auto;
  font-size: .78rem;
  padding: 9px 13px;
}

.home-stats-tabs {
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
  border-radius: 17px;
  display: flex;
  gap: 6px;
  margin-bottom: 13px;
  overflow-x: auto;
  padding: 7px;
  scrollbar-width: none;
}

.home-stats-tabs::-webkit-scrollbar { display: none; }

.home-stats-tabs button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
}

.home-stats-tabs button.active {
  background: rgba(242, 184, 75, .15);
  border-color: rgba(242, 184, 75, .3);
  color: var(--gold);
}

@media (max-width: 560px) {
  .home-statistics-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .home-statistics-title .secondary {
    font-size: .72rem;
    min-height: 36px;
    padding: 8px 11px;
  }

  .home-stats-tabs {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    margin-left: -16px;
    margin-right: -16px;
    padding: 6px 16px;
  }

  .home-stats-tabs button {
    font-size: .72rem;
    min-height: 34px;
    padding: 7px 10px;
  }

  .wallet-grid {
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .collector-grid { grid-template-columns: 1fr; }

  .wallet-grid article {
    border-radius: 14px;
    min-width: 0;
    padding: 12px;
  }

  .stats-grid article {
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 78px;
    min-width: 0;
    padding: 11px;
  }

  .wallet-grid strong {
    font-size: 1.22rem;
    margin: 6px 0 4px;
  }

  .wallet-grid span,
  .wallet-grid small {
    font-size: .68rem;
    line-height: 1.25;
  }

  .dashboard-section { margin-top: 30px; }

  .section-title h3 {
    font-size: 1.42rem;
    margin: 5px 0 13px;
  }

  .stats-grid strong {
    font-size: 1.16rem;
    line-height: 1.05;
    margin-bottom: 6px;
  }

  .stats-grid span {
    font-size: .66rem;
    line-height: 1.22;
  }

  .wallet-summary,
  .metrics-grid,
  .account-facts-wide,
  .settings-wallet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-summary article,
  .metric-card,
  .settings-wallet article {
    border-radius: 14px;
    min-width: 0;
    padding: 12px;
  }

  .wallet-summary strong,
  .settings-wallet strong {
    font-size: 1.2rem;
    margin: 6px 0 4px;
  }

  .wallet-summary span,
  .wallet-summary small {
    font-size: .68rem;
    line-height: 1.25;
  }

  .metrics-grid { gap: 8px; }

  .metric-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 76px;
  }

  .metric-card strong {
    font-size: 1.17rem;
    line-height: 1.08;
    margin-bottom: 6px;
  }

  .metric-card span {
    font-size: .68rem;
    line-height: 1.24;
  }

  .account-facts { gap: 8px; }
  .account-facts div { min-width: 0; padding: 11px; }
  .account-facts span,
  .account-facts small { font-size: .68rem; }
  .account-facts strong { font-size: .88rem; }

  .library-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-card-actions {
    justify-content: stretch;
    width: 100%;
  }

  .library-card-actions button { flex: 1 1 auto; }

  .book-preview-viewer {
    gap: 10px;
    padding: 0;
  }

  .book-preview-page {
    border-radius: 10px;
    padding: 5px;
  }
}

@media (max-width: 350px) {
  .stats-grid,
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
