/* Compact order positions, header actions, 2026-10-12. */
body #order-items .order-item{padding:8px 12px 12px!important;margin:0 0 10px!important;min-width:0}
body #order-items .position-heading{display:flex!important;align-items:center;gap:10px;width:100%;box-sizing:border-box;margin:0;padding:0 4px;font-size:13px!important}
body #order-items .position-heading>span:first-child{white-space:nowrap;font-weight:700}
body #order-items .position-move-actions{display:flex;gap:5px;margin-left:auto}
body #order-items .position-heading button,body #order-items .position-total-actions button{min-height:28px!important;padding:4px 8px!important;font-size:12px!important;line-height:1.2!important;box-shadow:none!important}
body #order-items .position-heading .position-arrow{width:28px!important;min-width:28px!important;padding:3px!important;font-size:16px!important}
body #order-items .order-item label{margin:0!important;font-size:12px!important;gap:4px!important;min-width:0}
body #order-items .order-item textarea{min-height:54px!important;height:54px;padding:6px 8px!important;resize:vertical}
body #order-items .position-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px!important;margin:8px 0 0!important}
body #order-items .position-grid input,body #order-items .position-grid select{min-height:32px!important;padding:5px 8px!important;font-size:13px!important}
body #order-items .position-total{grid-column:1/-1}
body #order-items .position-total-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:28px}
body #order-items .position-total-actions output{font-size:14px!important;font-weight:700}
body #order-items .position-total-actions [data-remove]{margin:0!important;color:#b45353!important;white-space:nowrap}
@media(max-width:600px){body #order-items .order-item{padding:8px 10px!important}body #order-items .position-heading{gap:6px}body #order-items .position-heading button{font-size:11px!important;padding:4px 6px!important}body #order-items .position-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

body #order-items legend.position-heading{display:block!important;width:100%!important;max-width:100%;box-sizing:border-box}
body #order-items .position-heading-row{display:flex!important;align-items:center;gap:12px;width:100%;white-space:normal}
body #order-items .position-heading-row>span:first-child{white-space:nowrap;margin-right:16px}
body #order-items .position-move-actions{display:flex!important;gap:6px;margin-left:auto!important;flex-shrink:0}
body #order-items .position-total-heading{display:flex!important;align-items:center;justify-content:space-between;width:100%;gap:16px;font-size:12px;font-weight:600}
body #order-items .position-total-heading [data-remove]{margin:0 0 0 auto!important;white-space:nowrap;color:#b45353!important;font-size:12px!important;padding:0!important;min-height:24px!important}
body #order-items .position-total>output{display:block;margin-top:4px;font-size:14px;font-weight:700}
@media(max-width:600px){body #order-items .position-heading-row{gap:6px}body #order-items .position-heading-row>span:first-child{margin-right:8px}}

body #order-items .order-item textarea[data-field="description"]{box-sizing:border-box!important;height:auto;max-height:none!important;overflow-y:hidden!important;resize:none}

/* Small, readable acknowledgement while editing an order. */
#order-form[data-save-state] .order-save-bar {
  position: sticky;
  bottom: max(6px, env(safe-area-inset-bottom));
  z-index: 4;
  display: flex;
  flex-flow: row wrap;
  align-items: baseline;
  gap: 2px 10px;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin: 10px 0 0 auto;
  padding: 3px 7px;
  background: #fff;
  border-radius: 4px;
  color: #475461;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
#order-form[data-save-state="saved"] .order-save-bar { color: #305d43; }
#order-form[data-save-state="error"] .order-save-bar { color: #8c302b; }
#order-form .order-save-retry {
  border: 0;
  padding: 3px;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
#order-form .order-save-retry[hidden] { display: none; }
@media (max-height: 460px) {
  #order-form[data-save-state] .order-save-bar { position: static; }
}
