:root {
  color-scheme: light;
  font: 16px/1.5 system-ui, sans-serif;
  color: #202d24;
  background: #faf8f1;
  --green: #235a40;
  --border: #d8ded4;
  --muted: #516055;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.top {
  padding: 1rem max(1rem, calc((100% - 52rem) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid var(--border);
}
.brand { color: var(--green); font-weight: 750; }
#account { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; justify-content: flex-end; }
main { width: min(calc(100% - 2rem), 52rem); margin: 2.5rem auto; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.1; margin: 0 0 1.5rem; }
h2 { font-size: 1.25rem; margin: 0; }
.panel, dialog { border: 1px solid var(--border); background: #fff; border-radius: 1rem; padding: 1.25rem; }
form { display: grid; gap: .8rem; }
form > button { justify-self: start; }
#login { max-width: 26rem; }
label { display: grid; gap: .3rem; font-weight: 550; }
input, select, textarea, button { font: inherit; color: inherit; min-height: 2.75rem; }
input, select, textarea { width: 100%; background: #fff; border: 1px solid #aebbb0; padding: .45rem .6rem; border-radius: .45rem; }
button { border: 1px solid var(--green); padding: .5rem .9rem; border-radius: .5rem; background: var(--green); color: white; cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
.quiet { background: transparent; color: var(--green); border-color: var(--border); }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) 9rem 6rem; gap: .7rem; }
.list-heading, .actions { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.list-heading { margin-top: 1.75rem; }
.actions { justify-content: flex-end; }
ul { list-style: none; padding: 0; }
li { border-top: 1px solid var(--border); display: flex; align-items: center; gap: .8rem; padding: .65rem 0; }
li input { width: 1.2rem; min-height: auto; height: 1.2rem; accent-color: var(--green); flex-shrink: 0; }
.line-info { flex: 1; overflow-wrap: anywhere; }
.line-info small { display: block; color: var(--muted); }
.checked .line-name { color: var(--green); font-weight: 650; }
#empty { color: var(--muted); }
#feedback:not(:empty), #edit-feedback:not(:empty) { color: #8d3325; }
#edit-feedback:empty { display: none; }
.history { margin-top: 2.5rem; }
.history details { margin: .8rem 0; }
.receipt-preview { flex-direction: column; align-items: flex-start; }
.receipt-preview ul { margin: 0; }
#stock-feedback:empty, #import-feedback:empty { display: none; }
#recipe-feedback:empty, #plan-feedback:empty { display: none; }
.meal-slot { display: grid; gap: .65rem; margin-bottom: .85rem; padding: .8rem; border: 1px solid var(--border); border-radius: .55rem; }
.meal-slot > button { justify-self: start; }
.meal-choices { display: grid; gap: .35rem; }
.meal-choices label { display: flex; align-items: center; gap: .45rem; }
.meal-choices input { min-height: auto; width: auto; }
.meal-choice { display: flex; justify-content: space-between; gap: .5rem; }
.meal-choice input[type=number] { width: 6rem; }
.recipe-library-item { display: block; }
summary { cursor: pointer; font-weight: 600; }
#handoff { flex-wrap: wrap; }
.shop-link { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem .9rem; border: 1px solid var(--border); border-radius: .5rem; }
#order-dialog { width: min(calc(100% - 2rem), 37rem); max-height: 90dvh; }
#order-lines { margin: 0; }
#order-lines li { align-items: start; flex-direction: column; }
#order-lines .fields { width: 100%; }
#order-lines label.received { display: flex; gap: .5rem; align-items: center; }
#order-feedback:empty { display: none; }
dialog { width: min(calc(100% - 2rem), 27rem); }
dialog::backdrop { background: #15221b80; }
@media (max-width: 38rem) {
  .fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .product { grid-column: 1 / -1; }
  main { margin-top: 1.7rem; }
}
