/* Phones and small tablets: the sidebar becomes a top bar with a scrolling mode row. */
@media (max-width: 860px) {
  :root { --side-w: 0px; }
  .overlay { position: fixed; inset: 0 0 auto 0; display: flex; flex-direction: column; }
  .app-side { position: static; width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .app-brand { padding: 8px 14px; }
  .app-brand small, .app-side-label, .app-side-foot, .app-nav i { display: none; }
  .app-nav { flex-direction: row; overflow-x: auto; padding: 0 8px 8px; width: 100%; scrollbar-width: none; }
  .app-nav button { width: auto; flex: none; white-space: nowrap; }
  header { position: static; padding: 6px 12px; min-height: 0; }
  .toolbar-actions { justify-content: flex-start; }
}
@media (max-width: 768px) {
  #walkStatus { font-size: 11px; }
  #scanPanel { padding: 18px 12px; }
  #scanPanel[open] { gap: 18px; }
  .picker-hint { display: block; }
  .quality-toggle { margin-left: auto; }
  .picker-hint { display: none; }
  .scan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-height: 0; overflow: auto; padding: 2px; }
  .scan-grid > :first-child, .scan-grid .col-header, .scan-btn:disabled { display: none; }
  .scan-grid .row-header { grid-column: 1 / -1; text-align: left; font-size: 11px; padding: 14px 0 4px; border-top: 1px solid var(--line); margin-top: 6px; }
  .unassigned-scans { display: contents; }
  .scan-note { grid-column: 1 / -1; padding: 0 0 4px; }
  .scan-btn { min-height: 40px; padding: 8px; font-size: 11px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
  .scan-btn[data-space]::before { content: attr(data-space); color: var(--ink); }
  .controls-hint {
    font-size: 0.65rem;
    padding: 0.4rem 0.8rem;
    bottom: 0.5rem;
  }
  .joystick {
    bottom: 4.5rem;
    left: 1rem;
    width: 100px;
    height: 100px;
  }
  .joystick-knob {
    width: 42px;
    height: 42px;
    margin: -21px 0 0 -21px;
  }
  .vertical-pad {
    bottom: 4.5rem;
    right: 1rem;
    gap: 0.5rem;
  }
  .vert-btn {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
  .loading-pill {
    top: auto;
    bottom: 5rem;
  }
  .click-prompt {
    min-width: 0;
    max-width: 90vw;
    padding: 1rem 1.4rem;
    font-size: 0.9rem;
  }
}

