.customer-search {
  height: 44px;
  margin-bottom: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbfa;
  display: flex;
  align-items: center;
  gap: 9px;
}

.customer-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
}

.customer-search > small {
  padding: 2px 7px;
  border-radius: 5px;
  background: #e9ecea;
  color: var(--muted);
  font-size: 9px;
}

.customer-search > .search-icon {
  position: relative;
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.customer-search > .search-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 9px;
  height: 9px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
}

.customer-search > .search-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 11px;
  width: 6px;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.customer-panel .customers {
  max-height: 270px;
  padding-right: 6px;
  grid-template-columns: 1fr;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b9c0bc #eef0ef;
}

.customer-panel .customers::-webkit-scrollbar {
  width: 7px;
}

.customer-panel .customers::-webkit-scrollbar-track {
  border-radius: 7px;
  background: #eef0ef;
}

.customer-panel .customers::-webkit-scrollbar-thumb {
  border-radius: 7px;
  background: #b9c0bc;
}

.customer-panel .customer {
  min-height: 84px;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.customer-panel .customer.selected {
  border-color: #5f9170;
  background: #e6f2ea;
  box-shadow: inset 0 0 0 1px #5f9170;
}

.customer-panel .customer.selected > i {
  border-color: var(--green);
  background: #fff;
}

.customer-panel .customer.selected b {
  color: #244f34;
}

.customer-panel .customer.selection-leave {
  animation: customer-selection-out 140ms ease-in forwards;
}

.customer-panel .customer.selection-enter {
  animation: customer-selection-in 190ms ease-out both;
}

.customer-panel .customers.is-changing {
  pointer-events: none;
}

@keyframes customer-selection-out {
  from {
    border-color: #5f9170;
    background: #e6f2ea;
    box-shadow: inset 0 0 0 1px #5f9170;
  }
  to {
    border-color: var(--line);
    background: #fff;
    box-shadow: inset 0 0 0 0 rgba(95, 145, 112, 0);
  }
}

@keyframes customer-selection-in {
  from {
    border-color: var(--line);
    background: #fff;
    box-shadow: inset 0 0 0 0 rgba(95, 145, 112, 0);
  }
  to {
    border-color: #5f9170;
    background: #e6f2ea;
    box-shadow: inset 0 0 0 1px #5f9170;
  }
}

.product {
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.product.selected {
  border-color: #5f9170;
  background: #e6f2ea;
  box-shadow: inset 0 0 0 1px #5f9170;
}

.customer-empty {
  padding: 35px 15px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.order-comment textarea {
  display: block;
  width: 100%;
  min-height: 110px;
  padding: 12px 13px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #fafbfa;
  font: inherit;
  line-height: 1.5;
}

.order-comment textarea:focus {
  border-color: #7fa08a;
  box-shadow: inset 0 0 0 1px #7fa08a;
}

.order-comment > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}

.review-no-products,
.drawer-no-products {
  margin: 0;
  padding: 15px 0;
  color: var(--muted);
  font-size: 10px;
}

.review-comment {
  padding: 16px 21px;
  border-top: 1px solid var(--line);
  background: #fafbfa;
}

.review-comment small,
.drawer-comment small {
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
}

.review-comment p,
.drawer-comment p {
  margin: 5px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.drawer-comment {
  margin-top: 17px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfa;
}

.drawer .edit-order {
  width: 100%;
  margin-top: 18px;
}

.weight-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--green-light);
  color: var(--green);
  font-size: 8px;
  font-weight: 700;
  vertical-align: 1px;
}

.weight-controls {
  min-width: 148px;
  display: grid;
  grid-template-columns: minmax(62px, 1fr) 35px 35px;
  align-items: center;
  gap: 5px;
}

.weight-controls > span {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.weight-controls button {
  width: 35px;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9f8;
  cursor: pointer;
}

.weight-controls .weight-add {
  background: var(--graphite);
  border-color: var(--graphite);
  color: #fff;
}

.weight-controls .weight-clear {
  color: var(--red);
}

.weight-controls button:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.weight-modal .weight-available {
  margin-top: -5px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 700px) {
  html,
  body,
  button,
  a,
  label,
  input,
  select {
    touch-action: manipulation;
  }

  body {
    font-size: 12px;
  }

  .search input,
  .customer-search input,
  .order-comment textarea {
    font-size: 16px;
  }

  .site-header {
    height: 54px;
  }

  .brand-logo {
    width: 116px;
    height: 36px;
  }

  .page {
    width: calc(100% - 18px);
    padding-top: 19px;
  }

  .page h1 {
    font-size: 24px;
  }

  .flow {
    min-height: calc(100dvh - 54px);
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .flow-header {
    height: 76px;
    padding: 0 9px;
  }

  .flow-header h1 {
    font-size: 17px;
  }

  .flow-header .overline {
    font-size: 7px;
  }

  .round {
    width: 34px;
    height: 34px;
  }

  .steps b {
    width: 22px;
    height: 22px;
    font-size: 9px;
  }

  .steps i {
    width: 8px;
  }

  .flow-body {
    width: calc(100% - 18px);
    padding: 10px 0;
  }

  .search {
    top: 63px;
    height: 44px;
    padding: 0 11px;
  }

  .category-toggle {
    min-height: 46px;
    padding: 0 12px;
  }

  .category-toggle h2 {
    font-size: 13px;
  }

  .product {
    min-height: 88px;
    padding: 11px;
  }

  .product h3 {
    font-size: 12px;
    margin-top: 0;
  }

  .weight-controls {
    min-width: 132px;
    grid-template-columns: minmax(50px, 1fr) 32px 32px;
  }

  .weight-controls button {
    width: 32px;
    height: 32px;
  }

  .weight-controls > span {
    font-size: 10px;
  }

  .counter {
    height: 32px;
  }

  .counter button {
    width: 30px;
  }

  .panel {
    padding: 12px;
  }

  .section-title {
    margin-bottom: 12px;
  }

  .customer-search {
    height: 40px;
  }

  .customer-panel .customers {
    max-height: 226px;
  }

  .customer-panel .customer {
    min-height: 70px;
    padding: 10px;
  }

  .flow-footer {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-height: 78px;
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 -8px 24px rgba(28, 32, 30, .09);
    transform: translateZ(0);
    z-index: 100;
  }

  .flow-footer .btn {
    min-height: 40px;
  }

  .flow-footer > div:first-child b {
    font-size: 15px;
  }

  .review-list > div {
    grid-template-columns: minmax(0, 1fr) 32px 76px;
  }
}
