.manual-orders-admin {
  max-width: 1440px;
  margin: auto;
  padding: clamp(16px, 3vw, 40px);
  color: var(--ink, #412b2d);
}
.mo-guide,
.mo-desk {
  padding: 24px;
  border: 1px solid #d7cbbb;
  border-radius: 14px;
  background: #f7f3eb;
  margin: 20px 0;
}
.command-center .manual-orders-admin .button {
  color: #fff;
  background: #541d2d;
  border: 1px solid #541d2d;
}
.command-center .manual-orders-admin .button.secondary {
  color: #541d2d;
  background: #fffdf9;
  border-color: #cdbfb0;
}
.mo-guide h3,
.mo-desk h2 {
  margin: 8px 0 12px;
  font-family: inherit;
}
.mo-guide p,
.mo-desk p {
  max-width: 75ch;
  line-height: 1.6;
}
.mo-stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 20px 0 0;
  list-style: none;
  border-top: 1px solid #d7cbbb;
  margin-top: 24px;
}
.mo-stepper li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #75685f;
}
.mo-stepper li > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #c8b9a8;
  border-radius: 50%;
  flex-shrink: 0;
}
.mo-stepper .current {
  color: #652337;
  font-weight: 700;
}
.mo-stepper .current > span {
  background: #652337;
  color: #fff;
}
.mo-stepper .complete > span {
  background: #e1e9df;
  color: #34583e;
}
.mo-quick-links,
.mo-desk-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
.mo-quick-links a {
  border: 1px solid #d7cbbb;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
}
.mo-desk details {
  border-top: 1px solid #d7cbbb;
  padding-top: 20px;
  margin-top: 24px;
}
.mo-desk summary {
  cursor: pointer;
  font-weight: 650;
}
.mo-desk li {
  line-height: 1.7;
  padding: 7px 0;
  max-width: 80ch;
}
.mo-print-slip[hidden] {
  display: none;
}
@media (max-width: 650px) {
  .mo-stepper {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .mo-guide,
  .mo-desk {
    padding: 18px;
  }
  .mo-desk-links .button {
    width: 100%;
  }
}
@media print {
  body:has([data-manual-printing]) {
    background: #fff !important;
  }
  body:has([data-manual-printing]) * {
    display: none !important;
  }
  body:has([data-manual-printing]) *:has([data-manual-printing]) {
    display: contents !important;
  }
  body:has([data-manual-printing]) [data-manual-printing],
  body:has([data-manual-printing]) [data-manual-printing] * {
    display: revert !important;
    visibility: visible !important;
  }
  body:has([data-manual-printing]) [data-manual-printing] {
    display: block !important;
    position: static;
    width: 100%;
    background: #fff;
    color: #111;
    padding: 20px;
    box-sizing: border-box;
  }
  .mo-slip-page {
    break-after: auto;
    font: 12pt/1.5 sans-serif;
  }
  .mo-slip-page + .mo-slip-page {
    break-before: page;
  }
  .mo-slip-page header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #111;
    padding: 12px 0;
  }
  .mo-slip-page table {
    width: 100%;
    border-collapse: collapse;
  }
  .mo-slip-page td,
  .mo-slip-page th {
    text-align: left;
    padding: 12px 4px;
    border-bottom: 1px solid #bbb;
  }
  .mo-slip-page footer {
    padding-top: 30px;
    font-size: 9pt;
  }
}
.mo-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.mo-heading h1,
.mo-heading h2 {
  margin: 8px 0;
}
.mo-revision {
  font: 600 12px/1.5 sans-serif;
  padding: 8px 12px;
  border: 1px solid #bda991;
  border-radius: 4px;
  white-space: nowrap;
}
.mo-search {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  padding: 20px 0;
}
.mo-search .field,
.mo-action .field {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.mo-search input,
.mo-search select,
.mo-action input,
.mo-action select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #b7aba0;
  border-radius: 3px;
  background: #fffdf9;
  color: inherit;
  font: inherit;
  box-sizing: border-box;
}
.mo-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.mo-queue {
  border: 1px solid #d7cbbb;
  background: #fcf8f1;
  max-height: 1100px;
  overflow: auto;
}
.mo-queue-row {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-bottom: 1px solid #d7cbbb;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.mo-queue-row.selected {
  box-shadow: inset 4px 0 #6a2939;
  background: #f2e9dc;
}
.mo-queue-row span {
  font-size: 13px;
}
.mo-detail {
  padding: clamp(16px, 2vw, 30px);
  border: 1px solid #d7cbbb;
  background: #fffdf9;
  min-width: 0;
  overflow-wrap: anywhere;
}
.mo-detail > section,
.mo-detail > details {
  border-top: 1px solid #ded4c7;
  margin-top: 24px;
  padding-top: 20px;
}
.mo-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.mo-facts dt {
  font-size: 12px;
  color: #725f56;
}
.mo-facts dd {
  margin: 7px 0;
  font-weight: 600;
}
.mo-table-wrap {
  max-width: 100%;
  overflow: auto;
}
.mo-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.mo-table-wrap caption {
  text-align: left;
  padding: 14px 0;
  font-weight: 600;
}
.mo-table-wrap th,
.mo-table-wrap td {
  padding: 12px 10px;
  border-bottom: 1px solid #e5dbce;
  vertical-align: top;
}
.mo-action {
  border: 1px solid #d7cbbb;
  margin: 12px 0;
  padding: 14px 18px;
}
.mo-action summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 30px;
}
.mo-action form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.mo-action form > button,
.mo-action form > p {
  grid-column: 1/-1;
}
.mo-action form > button {
  justify-self: start;
}
.manual-orders-admin a:focus-visible,
.manual-orders-admin summary:focus-visible,
.manual-orders-admin button:focus-visible {
  outline: 3px solid #906832;
  outline-offset: 3px;
}
.manual-orders-admin > nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}
@media (max-width: 900px) {
  .mo-search {
    grid-template-columns: 1fr 1fr;
  }
  .mo-search > .field:first-child {
    grid-column: 1/-1;
  }
  .mo-layout {
    grid-template-columns: 1fr;
  }
  .mo-queue {
    max-height: 300px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mo-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .mo-search,
  .mo-action form {
    grid-template-columns: 1fr;
  }
  .mo-queue {
    grid-template-columns: 1fr;
  }
  .mo-facts {
    grid-template-columns: 1fr 1fr;
  }
  .mo-detail {
    padding: 16px;
  }
  .mo-heading .button {
    width: 100%;
  }
}

/* The work queue stays readable without sideways scrolling on phones. */
.mo-work-tabs a[aria-current='page'] {
  background: #541d2d;
  color: #fff;
  border-color: #541d2d;
}
.mo-work-tabs b {
  display: inline-block;
  margin-left: 5px;
}
.mo-simple-flow,
.so-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  padding: 18px 0;
  gap: 12px;
  border-top: 1px solid #dddfd7;
}
.mo-simple-flow b,
.so-flow b {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8e9df;
  margin-right: 6px;
}
.mo-next-link {
  font-weight: 650;
  line-height: 1.5;
}
.mo-setup-list {
  padding-left: 25px;
}
.mo-setup-list li {
  margin: 12px 0 24px;
  padding-left: 8px;
}
.mo-setup-list :is(strong, span, a, button) {
  display: block;
}
.mo-setup-list a,
.mo-setup-list button {
  margin-top: 12px;
  width: fit-content;
}
.mo-setup-list span {
  max-width: 78ch;
}
.mo-shipstation h2 {
  margin-bottom: 16px;
}
@media (max-width: 650px) {
  .manual-orders-admin {
    padding: 0;
  }
  .mo-simple-flow {
    grid-template-columns: 1fr 1fr;
    font-size: 13px;
  }
  .mo-orders-table thead {
    display: none;
  }
  .command-center .mo-orders-table,
  .command-center .mo-orders-table tbody {
    display: block;
    width: 100%;
  }
  .command-center .mo-orders-table tr {
    display: block;
    border: 1px solid #dddfd7;
    border-radius: 12px;
    margin: 0 0 14px;
    overflow: hidden;
  }
  .command-center .mo-orders-table th,
  .command-center .mo-orders-table td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 15px;
    white-space: normal;
    text-align: right;
    overflow-wrap: anywhere;
  }
  .command-center .mo-orders-table th {
    background: #f3f2ec;
    text-align: left;
    font-size: 16px;
  }
  .command-center .mo-orders-table td::before {
    content: attr(data-label);
    font-weight: 550;
    flex-shrink: 0;
    text-align: left;
  }
  .mo-search {
    grid-template-columns: 1fr;
  }
  .mo-work-tabs {
    gap: 7px;
  }
  .mo-work-tabs a {
    padding: 10px;
  }
}
.command-center .mo-work-tabs a[aria-current='page'] {
  color: #fff;
}
.command-center .mo-desk-compact {
  margin: 0 0 20px;
  padding: 18px 22px;
}
.mo-desk-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.command-center .mo-desk-heading h2 {
  margin: 0;
  font-size: 18px;
}
.command-center .mo-desk-heading p,
.command-center .mo-desk-compact > p {
  margin: 6px 0 0;
}
.mo-desk-compact .mo-simple-flow {
  margin: 14px 0 8px;
  padding: 12px 0 0;
  font-size: 13px;
}
.mo-desk-compact .mo-simple-flow li {
  padding: 0;
}
.mo-desk-heading .button {
  flex-shrink: 0;
}
@media (max-width: 650px) {
  .mo-desk-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .mo-desk-heading .button {
    text-align: center;
  }
}

.mo-item-selection {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #d8cbbb;
  border-radius: 12px;
  margin: 1rem 0;
}
.mo-item-selection legend {
  font-weight: 700;
  padding: 0 0.4rem;
}
.mo-item-selection .field {
  min-width: 0;
}

@media (max-width: 640px) {
  .mo-detail .mo-table-wrap thead {
    display: none;
  }
  .mo-detail .mo-table-wrap table,
  .mo-detail .mo-table-wrap tbody {
    display: block;
    width: 100%;
  }
  .mo-detail .mo-table-wrap tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #d8cbbb;
  }
  .mo-detail .mo-table-wrap th {
    grid-column: 1 / -1;
    padding: 0;
    text-align: left;
  }
  .mo-detail .mo-table-wrap td {
    display: flex;
    flex-direction: column;
    border: 0;
    padding: 0;
    font-size: 18px;
  }
  .mo-detail .mo-table-wrap td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: #685b60;
  }
}
@media (max-width: 640px) {
  .mo-detail .mo-table-wrap caption {
    display: block;
    width: 100%;
    text-align: left;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
}
