.entry-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto 16px;
}

.entry-method {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.entry-method b { font-size: .9rem; }
.entry-method span { color: var(--muted); font-size: .68rem; }
.entry-method.active {
  color: #fff;
  border-color: var(--teal);
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  box-shadow: 0 10px 25px #076b6525;
}
.entry-method.active span { color: #d7fff5; }

.manual-start {
  display: grid;
  place-items: center;
  min-height: 390px;
  padding: 35px;
  text-align: center;
}
.manual-start h2 { margin: 8px 0 0; }
.manual-start p { max-width: 430px; margin: 5px auto 20px; color: var(--muted); }
.manual-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 0;
  padding: 0;
  border-radius: 18px;
  color: var(--teal-dark);
  background: var(--mint);
  font-family: inherit;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.manual-icon:hover { transform: translateY(-2px); box-shadow: 0 8px 20px #0b766f26; }
.manual-icon:active { transform: translateY(0); }
.manual-icon:focus-visible { outline: 3px solid var(--teal-dark); outline-offset: 3px; }

.manual-mode .review-layout { grid-template-columns: 1fr; }

@media (max-width: 520px) {
  .entry-method { padding: 11px; }
  .manual-start { min-height: 310px; padding: 22px; }
}

/* A one-option tab bar is noise: hide it when AI scan is switched off. */
.entry-choice.single-method { display: none; }

/* ---- Manual entry: one product group, many number lines ---- */
.order-group .line-head,
.order-group .order-line {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) 34px;
  gap: 8px;
  align-items: center;
}
.order-group .line-head {
  margin: 10px 0 2px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .6;
}
.order-group .order-line { margin-bottom: 7px; }
.order-group .lf { display: block; }
.order-group .lf input { width: 100%; }
.order-group .delete-line {
  width: 34px; height: 34px; padding: 0; line-height: 1;
  border: 1px solid #d9c2c0; border-radius: 8px;
  background: #fff; color: #b23b32; font-size: 1rem; cursor: pointer;
}
.order-group .delete-line:hover { background: #fff0ed; }
.order-group .add-line {
  margin-top: 4px; padding: 7px 12px;
  border: 1px dashed #9dc6bf; border-radius: 9px;
  background: transparent; color: #0b766f;
  font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer;
}
.order-group .add-line:hover { background: #eef8f5; }

/* On a phone the column header is dropped and each field labels itself.
   Number gets the full width because it is the field being read off the paper;
   the amounts pair up beneath it, Big beside Small and A beside C, which is
   how they are written down. */
@media (max-width: 640px) {
  .order-group .line-head { display: none; }
  .order-group .order-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 12px;
    margin-bottom: 11px;
    border: 1px solid #dde7e5;
    border-radius: 12px;
    background: #fbfdfd;
  }
  .order-group .lf::before {
    content: attr(data-label);
    display: block; margin-bottom: 4px;
    font-size: .6rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .04em; opacity: .6;
  }
  .order-group .lf:first-child { grid-column: 1 / -1; }
  .order-group .delete-line {
    grid-column: 1 / -1;
    justify-self: end;
    width: auto; height: auto;
    padding: 6px 14px;
    font-size: .68rem; font-weight: 700;
  }
  .order-group .delete-line::after { content: ' Remove'; }
}

/* ---- "Same amounts for every number" ---- */
.same-amounts {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 10px 0 2px;
  padding: 9px 11px;
  border: 1px solid #cfe4e0;
  border-radius: 10px;
  background: #f4fbf9;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 700;
}
.same-amounts input { width: auto; margin: 2px 0 0; flex: none; }
.same-amounts small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 500;
}

/* Locked: only the first line keeps its amount boxes. The other lines keep
   their values in the DOM, so unticking gives them straight back. */
.order-group.amounts-locked .order-line:not(:first-child) .lf:not(:first-child) {
  display: none;
}
/* Columns are pinned explicitly: with the amount boxes hidden, auto-placement
   would drop the note after the remove button instead of before it. */
.order-group.amounts-locked .order-line:not(:first-child) .lf:first-child {
  grid-column: 1 / 5;
  grid-row: 1;
}
.order-group.amounts-locked .order-line:not(:first-child)::after {
  content: '↑ same / 相同';
  grid-column: 5;
  grid-row: 1;
  align-self: center;
  white-space: nowrap;
  color: var(--muted);
  font-size: .62rem;
  font-style: italic;
}
.order-group.amounts-locked .order-line:not(:first-child) .delete-line {
  grid-column: 6;
  grid-row: 1;
}
@media (max-width: 640px) {
  .order-group.amounts-locked .order-line:not(:first-child) .lf:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .order-group.amounts-locked .order-line:not(:first-child)::after {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .order-group.amounts-locked .order-line:not(:first-child) .delete-line {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

/* ---- Optional product icons ---- */
.product-picker .product-icon {
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 5px;
  object-fit: contain;
  vertical-align: middle;
}
