/* 1.0.1: Android supplies an already-safe, physically resized viewport.
   These are comfort gutters, not a second copy of system/IME inset heights. */
@media screen and (max-width: 760px), screen and (pointer: coarse) {
  button, .btn, .btn.small, .btn.icon, .reader-tools .btn,
  .catalog-pagination .btn, .page-navigation .btn, .nav-item, .tab,
  .query-chip, .chapter-link, .text-link, .toast-undo, .medicine-item,
  .compare-column > header > .btn.icon, .note-card .note-remove {
    min-width: 48px; min-height: 48px; touch-action: manipulation;
  }
  .btn.icon, .compare-column > header > .btn.icon, .note-card .note-remove {
    width: 48px; height: 48px; flex-shrink: 0;
  }
  input:not([type="file"]):not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 48px; }
  .reader-page-tools { grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 10px; }
  .reader-tools { top: 12px; }
  .access-bar { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .primary-nav { gap: 8px; padding-top: 4px; padding-bottom: 16px; }
  .result-actions, .entry-find-controls, .catalog-pagination, .page-navigation { gap: 10px; }
  .back-to-top { right: max(18px, env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
  .source-dialog { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
  .dialog-heading { padding-top: 20px; }
  .dialog-footer { padding-bottom: 20px; }
  #access-screen, #admin-panel { margin: 16px auto; padding: 20px; }
}
/* Short landscape/keyboard view: never let a sticky toolbar occupy the reader. */
@media screen and (max-height: 479px) {
  .reader-tools { position: static; top: auto; }
}
@media screen and (max-width: 760px) {
  .reader-tools .btn { max-width: 100%; white-space: normal; line-height: 1.35; }
  .reader-identity, .reader-section-tools, .reader-page-tools { min-width: 0; }
}
