/* Below 64rem: Drive's phone. The frame goes; the top bar is one search pill
   with the menu at its start and the theme at its end; the sidebar is a
   drawer from the reading start; the page itself scrolls (so the browser's
   bars can tuck away). */
@media (max-width: 63.99rem) {
  body { background: var(--sheet); }
  .app { display: block; height: auto; min-height: 100dvh; }

  .top {
    position: sticky; top: 0; z-index: 30; isolation: isolate; gap: 0; height: auto;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px; background: var(--sheet);
  }
  .top::before {
    content: ""; position: absolute; z-index: -1; inset: max(8px, env(safe-area-inset-top)) 12px 8px;
    border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border);
    transition: box-shadow 150ms;
  }
  .top:focus-within::before { box-shadow: var(--shadow-sm), 0 0 0 2px var(--accent-line); }
  .lead { min-width: 0; padding-inline-start: 4px; gap: 0; }
  .fold, .brand { display: none; }
  .menu { display: inline-grid; width: 40px; height: 40px; }
  .find { max-width: none; margin: 0; }
  .find input {
    height: 48px; padding: 0 40px 0 6px; font-size: 16px; /* 16px: iOS does not zoom on focus */
    background: transparent !important; box-shadow: none !important;
  }
  .find-icon, .find kbd { display: none; }
  .clear { inset-inline-end: 2px; }
  .trail { padding-inline-end: 4px; }

  /* The drawer */
  .side {
    position: fixed; z-index: 60; inset-block: 0; inset-inline-start: 0; width: min(304px, 86vw);
    padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
    background: var(--chrome); border-start-end-radius: 16px; border-end-end-radius: 16px; box-shadow: var(--shadow-menu);
    transform: translateX(-104%); visibility: hidden;
    transition: transform 240ms var(--ease-out), visibility 0s linear 240ms;
  }
  [dir="rtl"] .side { transform: translateX(104%); }
  .side[data-open] { transform: none; visibility: visible; transition: transform 240ms var(--ease-out); }
  .drawer-brand { display: flex; align-items: center; gap: 10px; padding: 6px 12px 18px; }
  .nav-row { height: 44px; }
  .scrim { position: fixed; inset: 0; z-index: 50; background: rgb(12 10 8 / 0.36); animation: fade 200ms var(--ease-out); }
  html.drawer-open { overflow: hidden; }

  /* The sheet is the page */
  .sheet {
    margin: 0; padding: 14px 16px max(40px, env(safe-area-inset-bottom)); overflow: visible;
    background: transparent; border: 0; border-radius: 0;
  }
  [dir="rtl"] .sheet { margin: 0; }
  .title-row { margin-bottom: 16px; }
  .title-row h1 { font-size: 24px; }
  .group + .group { margin-top: 26px; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { height: 60px; gap: 10px; padding-inline: 10px 10px; }
  .card .icon svg, .card .icon img { width: 36px; height: 36px; }
  .card .initial { width: 36px; height: 36px; }

  /* List rows: the name, then what it is, then the address - nothing dropped. */
  .list-head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 0; height: auto; padding: 10px 4px 11px; align-items: start; }
  .cell-name .name { line-height: 28px; }
  .cell-note, .cell-host { padding-inline-start: 40px; white-space: normal; line-height: 1.4; }
  .cell-note { font-size: 13px; margin-top: -4px; }
  .cell-host { font-size: 12px; }
}
@media (max-width: 22.4rem) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .side, .side[data-open] { transition: none; }
  .scrim { animation: none; }
}
