/* The second half of the stylesheet, loaded straight after style.css: the
   other screens' parts, the tab bar, the message slot, tasters, the PIN box,
   the Orders page, Sell's switch and quick-add (T-0057), and last stock left
   (T-0058). Split to stay under 400 lines a file (STANDARD rule 12); read one
   after the other they are the one stylesheet, rule for rule in the same
   order, so which rule wins is unchanged. */

.picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pick.chosen {
  border-color: var(--brand);
  background: var(--good);
  font-weight: 700;
}

.field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.5rem;
  align-items: center;
}

.field > span:first-child {
  grid-column: 1 / -1;
  font-weight: 600;
}

.unit {
  color: var(--muted);
  min-width: 2.5rem;
}

.count,
.row {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 2px solid var(--line);
  border-radius: 0.75rem;
}

.check {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-height: var(--tap);
}

.check input {
  width: 1.75rem;
  min-height: 1.75rem;
}

.actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid var(--line);
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}

.voided {
  color: var(--muted);
  text-decoration: line-through;
}

summary {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

.exports {
  display: flex;
  gap: 0.5rem;
}

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  padding: 0.375rem 0.375rem calc(0.375rem + env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 2px solid var(--line);
}

.tabs button {
  padding: 0.25rem;
  font-size: 0.9rem;
  border-radius: 0.5rem;
}

.tabs button[aria-current='page'] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--paper);
  font-weight: 700;
}

/* The sync line and the message take turns in one slot, stuck to the top. The
   slot holds no button, so a message never covers one (T-0054). It fits a
   message of two lines and its button, so showing one never moves the page. */
.slot {
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 2;
  display: grid;
  min-height: 4.25rem;
  padding: 0.5rem 0;
  background: var(--paper);
}

.slot > * {
  grid-area: 1 / 1;
}

.slot .bar {
  height: 100%;
  margin: 0;
  display: flex;
  align-items: center;
}

.toast {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.25rem 0.25rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: var(--paper);
}

.toast:empty {
  display: none;
}

.toast p {
  margin: 0;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.toast button {
  flex: none;
  min-height: 2.75rem;
}

.loading {
  padding: 2rem 0;
  color: var(--muted);
}

.tasters .sub {
  margin: 0;
}

.taster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.taster {
  border-style: dashed;
  background: var(--paper);
  font-weight: 600;
}

.pin {
  display: grid;
  gap: 0.5rem;
}

.pin input {
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  text-align: center;
}

/* T-0057: Sell's Take order | Orders switch, the Orders page, quick-add. */

.switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.switch button[aria-pressed='true'] {
  border-color: var(--brand);
  background: var(--good);
  font-weight: 700;
}

.editing {
  display: grid;
  gap: 0.5rem;
}

.editing p {
  margin: 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.375rem;
}

.steps button {
  padding: 0.25rem;
  font-weight: 700;
}

.list .actions {
  flex-shrink: 0;
}

.orders {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.order-card {
  display: grid;
  gap: 0.375rem;
  padding: 0.75rem;
  border: 2px solid var(--line);
  border-radius: 0.75rem;
}

.order-card p {
  margin: 0;
}

.order-card.ready {
  border-color: var(--brand);
  background: var(--good);
}

.order-card.collected {
  color: var(--muted);
}

.order-head {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.status-tag {
  margin-left: auto;
  padding: 0.1rem 0.6rem;
  border-radius: 1rem;
  background: var(--panel);
  font-weight: 700;
}

.order-note {
  font-style: italic;
}

.order-actions {
  display: grid;
  gap: 0.5rem;
}

.order-actions .actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* T-0058: the low-stock banner, items under their par level, the next-shop days. */
.low p {
  margin: 0;
  font-weight: 700;
}

.list li.low {
  font-weight: 700;
}

.switch.days {
  grid-template-columns: repeat(4, 1fr);
}
