/* Panel layouts start with a single, readable column on phones. */
.stock-summary { display: none; }
@media (max-width: 760px) {
  #admin > header { position: static; }
  #admin .wrap { padding-left: 16px; padding-right: 16px; }
  #admin header .bar { gap: 12px; padding-top: 12px; padding-bottom: 12px; }
  #admin .logo { flex: 1; font-size: 20px; }
  #admin #tabs { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; width: 100%; flex-basis: 100%; margin: 0; padding: 0; overflow: visible; }
  #admin #tabs button { position: relative; justify-content: center; flex-direction: column; gap: 4px; min-width: 0; min-height: 54px; padding: 6px 1px; border: 1px solid var(--line); border-radius: 10px; font-size: 11px; background: var(--surface); }
  #admin #tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  #admin #tabs button[aria-pressed="true"] .ic { color: inherit; }
  #admin #tabs b { position: absolute; top: 3px; right: 4px; min-width: 18px; padding: 0 4px; background: var(--sun); color: #0b1b4d; font-size: 11px; }
  #admin .panel { padding-top: 20px; padding-bottom: 32px; min-width: 0; }
  #admin .sec-head { align-items: stretch; gap: 12px; }
  #admin .sec-head h2 { width: 100%; margin: 0; font-size: 25px; }
  #admin .sec-head > div { width: 100%; justify-content: space-between; gap: 8px !important; }
  #admin .sec-head .search { max-width: none !important; width: 100%; flex-basis: 100%; }
  #admin .btn, #admin .toggle { min-height: 44px; align-items: center; }
  #admin .btn { display: inline-flex; justify-content: center; }
  #admin #board { grid-template-columns: minmax(0,1fr); margin: 0; padding: 0; overflow: visible; gap: 16px; scroll-snap-type: none; }
  #admin #board .col { min-height: 0; min-width: 0; max-height: none; padding: 10px; }
  #admin #board .col > .hint { min-height: 0; margin: 0; padding: 10px !important; border: 0; text-align: left; display: block; }
  #admin .order { min-width: 0; padding: 12px; font-size: 14px; overflow-wrap: anywhere; }
  #admin .order .acts button, #admin .order .acts a { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  #admin .order .acts .go { flex-basis: 100%; }
  #admin .tablewrap:has(#stockBody) { overflow: visible; border: 0; background: transparent; }
  #admin table:has(#stockBody), #stockBody { display: block; min-width: 0; width: 100%; }
  #admin table:has(#stockBody) thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  #stockBody tr { display: grid; grid-template-columns: minmax(0,1fr); margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  #stockBody td { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 8px; align-items: center; min-width: 0; padding: 10px 0; overflow-wrap: anywhere; }
  #stockBody td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 600; }
  #admin .panel[hidden] #stockBody td::before { content: none; }
  #stockBody td:first-child { display: block; font-size: 17px; padding: 0 0 12px; box-shadow: none; }
  #stockBody td:first-child::before { content: none; }
  #stockBody tr.stock-compact { margin-bottom: 8px; padding: 0 10px; border-radius: 12px; }
  #stockBody .stock-compact td:first-child { padding: 0; border-bottom: 0; }
  #stockBody .stock-original { display: none; }
  #stockBody .stock-compact:not(.stock-expanded) td:not(:first-child) { display: none; }
  #stockBody .stock-summary { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 10px; align-items: center; width: 100%; min-height: 82px; padding: 10px 0; border: 0; background: transparent; text-align: left; }
  #stockBody .stock-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--bg); display: grid; place-items: center; }
  #stockBody .stock-summary-info { display: grid; gap: 4px; min-width: 0; }
  #stockBody .stock-summary-info strong { font-size: 14px; line-height: 1.25; }
  #stockBody .stock-summary-meta { font-size: 12px; color: var(--muted); line-height: 1.35; }
  #stockBody .stock-summary-alert { font-size: 11px; font-weight: 600; color: var(--accent); }
  #stockBody .stock-summary-action { font-size: 11px; color: var(--second); }
  #stockBody .stock-summary-action::after { content: ' ⌄'; }
  #stockBody .stock-expanded .stock-summary-action::after { content: ' ⌃'; }
  #stockBody .stock-expanded td:first-child { border-bottom: 1px solid var(--line); }
  #stockBody tr.low { border-left: 4px solid var(--warn); }
  #stockBody tr.zero { border-left: 4px solid var(--accent); }
  #stockBody .photos { flex-wrap: wrap; min-width: 0; }
  #stockBody .stockctl button { width: 44px; height: 44px; }
  #stockBody .entry { flex-wrap: wrap; }
  #stockBody .entry input, #stockBody .entry button { min-height: 44px; }
  #admin input, #admin select, #admin textarea, .modal input, .modal select, .modal textarea { font-size: 16px; }
  #admin .pos, #admin .two { grid-template-columns: minmax(0,1fr); }
  #admin .pos { padding-bottom: 0; }
  #admin .pos > * { min-width: 0; }
  #admin #posChips { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; max-width: 100%; }
  #admin .ticket { position: static; width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: none; }
  #admin #ticketLines { max-height: none; overflow: visible; }
  #admin .tline, #omLines .tline { grid-template-columns: minmax(0,1fr) auto; }
  #admin .tline > span:first-child, #omLines .tline > span:first-child { grid-column: 1 / -1; overflow-wrap: anywhere; }
  #admin .tline .qty button, #omLines .tline .qty button { min-width: 44px; min-height: 44px; }
  #admin .posgrid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #admin .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  #admin .stats > * { min-width: 0; padding: 12px; overflow-wrap: anywhere; }
  #admin .sf-editor { overflow-wrap: anywhere; }
  .modal .sheet { max-height: 94dvh; }
}
@media (max-width: 360px) {
  #admin .stats { grid-template-columns: minmax(0,1fr); }
  #admin .order .acts { gap: 4px; }
}
