/* Phone layout (Samsung, iPhone): one column, tabs that scroll sideways, nothing runs off the edge. */
@media (max-width: 820px) {
  html, body { height: auto; overflow-x: hidden; }
  .top { flex-wrap: wrap; gap: 6px 12px; padding: 8px 12px; position: sticky; top: 0; z-index: 30; }
  .logo .l1, .logo .l3 { font-size: 18px; } .logo .l2 { font-size: 14px; } .logo small { display: none; }
  nav { order: 3; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  nav::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; padding: 8px 14px; flex: 0 0 auto; }
  .keystate { font-size: 12px; }
  main { height: auto; }
  .view.active { flex-direction: column; height: auto; }
  .panel { width: auto; min-width: 0; border-right: 0; overflow: visible; padding: 12px 14px 20px; }
  .stage, .gbody { overflow: visible; padding: 14px; }
  .starters { grid-template-columns: repeat(2, 1fr); }
  .presets { grid-template-columns: 1fr 1fr; }
  .chips { flex-wrap: wrap; }
  .results, .library { grid-template-columns: 1fr; }
  .trygrid, .wsgrid, .row { grid-template-columns: 1fr; }
  .prmotifs { grid-template-columns: repeat(4, 1fr); }
  input, select, textarea { font-size: 16px; }
  img, canvas, svg, video { max-width: 100%; height: auto; }
  .modal, .dialog, [class*="modal"] > div { max-width: calc(100vw - 24px); }
}
