/* ── Phones (≤ 760 px): one column, nothing wider than the screen ──────────
   Loaded after layout.css. The page becomes: header (brand + actions) ·
   section tabs sliding sideways · the preview pinned at the top · the panels
   under it, scrolling. Live code is folded (tap to open). Desktop unchanged. */
@media (max-width: 760px) {
  html, body.control { overflow-x: hidden; max-width: 100vw; }
  body.control { display: block; height: auto; min-height: 100dvh; overflow-y: auto; }
  input, select, textarea { font-size: 16px; }                    /* phones zoom into smaller fields */

  /* header: brand + a few actions on one line, the section tabs on their own sliding row */
  header.appbar { flex-wrap: wrap; gap: .3em .5em; padding: .3em .6em 0; min-height: 0; position: sticky; top: 0; z-index: 20; }
  header.appbar .brand { border-right: 0; min-height: 40px; padding-right: 0; margin-right: auto; }
  header.appbar .brand .logo { height: 26px; }
  header.appbar .brand .title { font-size: 1rem; }
  header.appbar .brand .subtitle { font-size: .66rem; }
  header.appbar > .hint, header.appbar > .sep, header.appbar > .identify, header.appbar > .redo { display: none; }
  header.appbar > button, header.appbar > a > button { min-height: 36px; }
  nav.sections { order: 10; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -.6em; padding: 0 .4em; }
  nav.sections::-webkit-scrollbar { display: none; }
  nav.sections .sectab { flex: none; padding: .7em .9em; }

  main.split { display: flex; flex-direction: column; grid-template-columns: none; }
  .splitter { display: none; }
  .left { overflow: visible; padding: .4em .4em 0; gap: .4em; }
  .right { min-width: 0; }

  /* the preview stays in view while the panels scroll under it */
  .preview-wrap { position: sticky; top: var(--hdr-h, 92px); z-index: 10; box-shadow: 0 6px 14px rgb(0 0 0 / .35); }
  .preview-bar { gap: .3em; padding: .25em; }
  .preview-bar > .hint { display: none; }
  .preview-bar select { max-width: 52vw; }
  .preview-area { padding: .2em; }

  /* panels: their own tab row slides sideways too; rows wrap instead of overflowing */
  .tab-bar { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; padding: 0 .3em; }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-bar .tab { flex: none; padding: .75em .8em; }
  .row, .row.nowrap { flex-wrap: wrap; }
  .param { grid-template-columns: minmax(5em, 34%) minmax(0, 1fr); }
  button, select { min-height: 36px; }
  button.icon, .icon { min-width: 36px; }
  .card, .mbox, .knobcard, .layer, .lrow { min-width: 0; }
  .card .head { flex-wrap: wrap; }
  .mgrid, .knobgrid, .grid2 { grid-template-columns: 1fr !important; }
  .seq .cells { min-width: 0; }
  .sheet { max-height: 80dvh; }
}
