/* ---------- Phones: the page scrolls, panels open as full-screen sheets ---------- */
@media (max-width: 700px) {
  .f-root { height: auto !important; min-height: 100vh !important; min-height: 100dvh !important; overflow: visible !important; overflow-x: clip !important; }
  html, body { overflow-x: clip; }
  header { position: sticky !important; top: 0; padding: 10px 12px !important; }
  nav[aria-label="Main"] { flex-wrap: nowrap !important; }
  nav[aria-label="Main"] button { padding: 8px 12px !important; font-size: 13px !important; white-space: nowrap; min-height: 38px !important; }
  main#top { padding: 6px 0 14px !important; gap: 14px !important; }
  [aria-label="Filter by role"] button { padding: 0 10px !important; }
  .f-region { flex: none !important; height: 430px !important; overflow: hidden !important; }
  .f-region > div { height: 100% !important; max-height: none !important; }
  .f-card { width: 62vw !important; max-width: 260px; }
  .f-bar { border-radius: 22px !important; justify-content: center; gap: 6px !important; padding: 6px 8px !important; width: auto !important; max-width: calc(100% - 24px) !important; }
  .f-bar > div:nth-child(3), .f-bar [aria-label="View"] { display: none !important; }
  .f-tc { display: none; }
  .f-bar button { padding: 0 12px !important; min-height: 40px !important; }
  .f-bar button[aria-label] { width: 38px !important; height: 38px !important; padding: 0 !important; }
  .f-viewhead { position: fixed; top: 0; left: 0; right: 0; z-index: 55; padding: 64px 8px 10px; background: linear-gradient(#140602 78%, rgba(20,6,2,0)); }
  .f-book { position: fixed !important; inset: 0 !important; z-index: 50 !important; justify-content: flex-start !important; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 200px 12px 48px; box-sizing: border-box; background: rgba(16,7,4,0.94); }
  header { z-index: 60 !important; }
  .f-book [style*="grid-template-columns: repeat(4, minmax(0, 1fr))"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .f-leaf { width: 46vw !important; }
  footer { font-size: 10px !important; text-align: center; padding: 0 16px 24px !important; }
}
/* Short desktop windows: let the work area scroll */
@media (min-width: 701px) and (max-height: 680px) {
  .f-region { overflow-y: auto !important; overflow-x: hidden !important; }
  .f-book { top: 0 !important; padding-bottom: 32px; }
}
