#modal{box-sizing:border-box;width:min(760px,calc(100% - 20px));max-height:90vh;max-height:90dvh;overflow-y:auto;overscroll-behavior:contain;padding:0 18px 18px}
.pedido-heading{position:sticky;top:0;z-index:2;background:white;padding:14px 0;border-bottom:1px solid #dce5ea;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px}
.pedido-heading h2{font-size:20px;margin:0}.pedido-heading button{min-height:44px;font-size:16px;padding:10px 14px}
#pedido-count{font-size:14px;margin:5px 0 0;color:#476579}
#customer{margin-top:14px}#selected{overflow:visible}.item{overflow-wrap:anywhere}.item input{width:100px!important}
#results button[data-add]{min-height:44px}#results button[data-add][data-selected="true"]{background:#16783f}
body{padding-bottom:96px}
@media (max-width:700px) and (orientation:portrait){
  #results tr{display:grid;grid-template-columns:minmax(0,1fr) 100px;align-items:center;padding:10px;gap:4px 10px}
  #results tr td{display:block!important;width:auto!important;min-width:0;border:0;padding:0!important;overflow-wrap:anywhere}
  #results tr td::before{display:none!important}
  #results tr td:nth-child(1){grid-column:1;grid-row:1;font-size:14px;color:#476579}
  #results tr td:nth-child(2){grid-column:1;grid-row:2;font-size:16px;line-height:1.35}
  #results tr td:nth-child(3){grid-column:1;grid-row:3;font-size:14px;color:#476579}
  #results tr td:nth-child(5){grid-column:2;grid-row:1 / 5;align-self:center;width:auto!important;padding:0!important}
  #results tr td:nth-child(5) button{width:100%!important;min-height:46px!important;padding:10px 6px!important;font-size:14px;white-space:normal}
}

/* QI de Lista corrida; conserva el botón Agregar a la derecha en teléfono. */
@media (min-width:701px){
  th:nth-child(1),td:nth-child(1){width:16%}
  th:nth-child(2),td:nth-child(2){width:44%}
  th:nth-child(3),td:nth-child(3){width:18%}
  th:nth-child(4),td:nth-child(4){width:8%;text-align:center}
  th:nth-child(5),td:nth-child(5){width:14%}
}
@media (max-width:700px){
  #results td.qi::before{content:'QI'}
  #results td.qi-empty{display:none!important}
}
@media (max-width:700px) and (orientation:portrait){
  #results td.qi{grid-column:1;grid-row:4;font-size:14px;color:#476579}
  #results td.qi::before{display:inline!important;content:'QI: ';margin:0;font:inherit}
}

/* Referencias de ofertas, sin importes ni cambios en el pedido enviado. */
.offer-guide{display:block;width:fit-content;max-width:100%;box-sizing:border-box;margin:6px 0 2px;padding:5px 8px;border:1px solid #e4c771;border-radius:6px;background:#fff8dd;color:#684b08;font-size:12px;line-height:1.45;overflow-wrap:anywhere}.offer-guide strong{font-size:11px;letter-spacing:.04em;margin-right:5px}
