/* 1.9.8: compact work controls. Load after mobile.css and the feature styles.
   Packing's generic form grid must not wrap a one-button shipment in an empty
   quantity column. Keep the actual quantity editor and all status messages. */
@media screen {
  .content .orders-page .packing-order-control .dispatch-control197 {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    gap: 3px 8px;
    width: 100%;
    margin-top: 3px;
    padding-top: 4px;
    border-top: 1px solid #d4e4db;
    min-width: 0;
  }
  .content .orders-page .dispatch-progress197 {
    flex: 1 1 150px;
    font-size: 14px;
    line-height: 1.4;
  }
  .content .orders-page .dispatch-actions197 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    min-width: 0;
    max-width: 100%;
  }
  .content .orders-page .dispatch-actions197:has(.dispatch-entry197[open]) {
    flex-basis: 100%;
    width: 100%;
  }
  .content .orders-page .dispatch-pick197 {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
    padding: 4px 6px;
    gap: 5px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
    border: 0;
    border-radius: 6px;
    background: transparent;
    white-space: nowrap;
  }
  .content .orders-page .dispatch-pick197 input {
    flex: 0 0 22px;
    min-height: 22px;
    padding: 0;
  }
  .content .orders-page .packing-order-control form.dispatch-record197 {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 5px 8px;
    width: auto;
    max-width: 100%;
    margin: 0 !important;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    grid-template-columns: none;
    min-width: 0;
  }
  .content .orders-page .packing-order-control form.dispatch-record197 > button,
  .content .orders-page .dispatch-entry197 > summary {
    width: auto;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 7px 10px;
    font-size: 15px;
    line-height: 1.35;
    grid-column: auto;
    grid-row: auto;
  }
  .content .orders-page .dispatch-entry197 {
    margin: 0;
    min-width: 0;
    max-width: 100%;
  }
  .content .orders-page .dispatch-entry197[open] {
    flex: 1 1 100%;
    padding: 7px;
    border-radius: 7px;
  }
  .content .orders-page .dispatch-entry197[open] > summary {
    width: max-content;
    max-width: 100%;
  }
  .content .orders-page .dispatch-entry197 form.dispatch-record197 {
    margin-top: 6px !important;
  }
  .content .orders-page .dispatch-record197 label {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
  }
  .content .dispatch-quantity197 {
    gap: 4px;
    margin-top: 3px;
  }
  .content .dispatch-quantity197 input {
    min-height: 44px;
    padding: 7px;
    font-size: 16px;
  }
  .content .dispatch-quantity197 button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 5px;
    font-size: 18px;
  }
  .content .orders-page .dispatch-hint197,
  .content .orders-page .dispatch-review197 {
    flex-basis: 100%;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
  }
  .content .orders-page .dispatch-record197 .form-message {
    display: block;
    flex: 1 1 100%;
    margin: 3px 0 0 !important;
    max-width: 100%;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  .content .orders-page .dispatch-record197 .form-message:empty,
  .content .dispatch-photo197 .form-message:empty,
  .content .dispatch-photo197 .upload-message:empty,
  .content .dispatch-photo197 .packing-photo-preview:empty {
    display: none;
  }
  .content .dispatch-pick197[hidden],
  .content .dispatch-batch197[hidden],
  .content .dispatch-photo197 [hidden] {
    display: none !important;
  }
  .content .dispatch-pick197:focus-within {
    outline: 3px solid #087c64;
    outline-offset: 1px;
  }
  .content .dispatch-trip197 {
    margin: 8px 0;
    padding: 9px 10px;
    border-radius: 8px;
  }
  .content .dispatch-trip-lines197 {
    margin: 5px 0 !important;
  }
  .content .dispatch-photo197 {
    margin: 4px 0;
  }
  .content .dispatch-photo197 > summary {
    min-height: 44px;
    padding: 7px 0;
    font-size: 14px;
    line-height: 1.4;
  }
  .content .dispatch-photo-options197 {
    gap: 6px;
  }
  .content .dispatch-photo-options197 form {
    padding: 7px;
  }
  .content .dispatch-photo-options197 label,
  .content .dispatch-photo-options197 button {
    margin: 0;
    min-height: 44px;
    font-size: 14px;
    line-height: 1.4;
  }
  .content .dispatch-photo-options197 button {
    margin-top: 5px;
  }
  .content .dispatch-photo197 .upload-message,
  .content .dispatch-photo197 .form-message {
    font-size: 14px;
    line-height: 1.45;
    margin: 4px 0 0;
  }
  .content .dispatch-photo197 small {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.4;
  }
  .content .dispatch-copy197 {
    gap: 4px 8px;
    margin: 5px 0;
  }
  .content .dispatch-copy197 button,
  .content .dispatch-copy197 summary,
  .content .dispatch-trip-link197 {
    min-height: 44px;
    font-size: 14px;
    line-height: 1.4;
  }
  .content .dispatch-copy197 button {
    padding: 7px 10px;
  }

  /* Scope to checklist cards, leaving the checklist detail/editor intact. */
  .content .checklist-grid {
    gap: 10px;
    align-items: start;
  }
  .content .checklist-grid > .checklist-card {
    padding: 11px 12px;
    border-radius: 9px;
  }
  .content .checklist-card .checklist-card-top {
    margin-bottom: 6px;
    gap: 5px;
  }
  .content .checklist-grid > .checklist-card .checklist-title h3 {
    margin: 0 0 4px;
    font-size: 18px;
    line-height: 1.4;
  }
  .content .checklist-card .checklist-assignee {
    font-size: 14px;
    line-height: 1.45;
    margin: 3px 0 6px;
  }
  .content .checklist-card .checklist-instructions {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 7px;
  }
  .content .checklist-card .checklist-shared {
    padding: 6px 8px;
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 7px;
  }
  .content .checklist-card .checklist-progress-line {
    margin: 7px 0;
  }
  .content .checklist-card form {
    margin-top: 7px;
  }
  .content .checklist-card .checklist-fast-buttons {
    gap: 5px;
  }
  .content .checklist-card .checklist-fast-buttons button {
    margin: 0;
    min-height: 44px;
    padding: 7px 8px;
    font-size: 15px;
    line-height: 1.4;
  }
  .content .checklist-card .checklist-reason {
    margin-top: 3px;
  }
  .content .checklist-card .checklist-reason > summary,
  .content .checklist-card .checklist-detail-link {
    min-height: 44px;
    margin: 0;
    padding: 7px 0;
    font-size: 14px;
    line-height: 1.4;
  }
  .content .checklist-card .form-message:empty {
    display: none;
  }
  .content .checklist-card .form-message {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 1.45;
  }
  .content .home-checklist-list {
    gap: 7px;
  }
  .content .checklist-grid > .home-checklist-card {
    padding: 8px 10px;
  }
  .content .home-checklist-card .checklist-title h3 {
    font-size: 17px;
    margin: 0;
  }
  .content .home-checklist-card .checklist-assignee {
    margin: 2px 0 3px;
  }
  .content .home-checklist-card form {
    margin-top: 0;
  }
  .content .home-checklist-card .home-checklist-controls {
    align-items: center;
    gap: 0 8px;
  }
  .content .home-checklist-card .home-checklist-controls > button {
    min-height: 44px;
    margin: 0;
    padding: 7px 10px;
    font-size: 14px;
    line-height: 1.4;
  }
  .content .home-checklist-card .home-checklist-details {
    flex-basis: 160px;
  }
  .content .home-checklist-card .home-checklist-details[open] {
    flex-basis: 100%;
  }
  .content .home-checklist-card .home-checklist-details > summary {
    min-height: 44px;
    padding: 7px 0;
    font-size: 14px;
    line-height: 1.4;
  }
  .content .home-checklist-card .home-checklist-body {
    padding-top: 6px;
  }
  .content .home-checklist-card .home-checklist-body p {
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.5;
  }
  .content .home-checklist-card .home-checklist-body textarea {
    min-height: 84px;
    font-size: 16px;
  }
}

@media screen and (max-width: 760px) {
  .content .orders-page .packing-order-control .dispatch-control197 {
    gap: 2px 6px;
  }
  .content .orders-page .dispatch-progress197 {
    flex-basis: 100%;
  }
  .content .orders-page .dispatch-pick197 {
    padding-left: 0;
    padding-right: 3px;
  }
  .content .orders-page .dispatch-actions197 {
    gap: 4px;
  }
  .content .orders-page .packing-order-control:has(.dispatch-entry197[open]) {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
  }
  .content .dispatch-batch197 {
    padding: 7px;
    margin-top: 8px;
  }
  .content .dispatch-batch197 .dispatch-batch-line197 label {
    font-size: 14px;
  }
  .content .dispatch-batch197 .dispatch-batch-line197 > strong {
    font-size: 15px;
    line-height: 1.4;
  }
  .content .dispatch-batch197 button[type="submit"],
  .content .dispatch-batch197 > .dispatch-button197 {
    font-size: 15px;
    min-height: 44px;
    padding: 7px 10px;
  }
}
