@media (max-width: 640px) {
  nav { padding: 12px 18px; gap: 10px; }
  .logo-text { font-size: 1.1rem; }
  .hero, .filter-bar, .shelf-section, .continue-section, .legend-section { padding-left: 18px; padding-right: 18px; }
  .hero { padding-top: 40px; padding-bottom: 24px; }
  .search-wrap { min-width: 140px; max-width: 100%; flex-basis: 100%; order: 3; }
  .shelf { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
  .spine { height: 168px; }
  .spine-title { font-size: 0.68rem; }
  .spine-skeleton { height: 168px; }
  .modal { padding: 22px; max-height: 94vh; }
  .modal .meta-grid { grid-template-columns: repeat(2, 1fr); }
  /* "Put back" is a desk metaphor for pointer users; on a phone the sheet's
     backdrop tap and the back gesture already close the card. */
  .modal-actions .put-back-btn { display: none; }
  /* three actions left: Open spans the top row, Download and Share share the
     second, so the primary action stays the obvious one */
  .modal-actions #readBtn { grid-column: 1 / -1; }
  .group-name { max-width: 50vw; font-size: 1rem; }
  .spotlight-card { padding: 30px 22px; }
  .filter-pill.surprise-pill { margin-left: 0; }
  .alpha-nav { top: 56px; }
}
