:root { --ink:#000; --paper:#fff; --accent:#0b3d91; --soft:#fff7cc; --line:#222; }
* { box-sizing: border-box; }
html { font-size: 22px; }
body { margin: 0 auto; max-width: 900px; padding: 16px; font-family: Verdana, Arial, sans-serif; color: var(--ink); background: var(--paper); line-height: 1.35; }
h1 { font-size: 2rem; margin: 0 0 .4rem; }
h2 { font-size: 1.3rem; margin: 1.2rem 0 .4rem; padding: .3rem .6rem; background: var(--accent); color: #fff; border-radius: 8px; }
h2.noloc { background: #6b2a00; }
h3 { font-size: 1.05rem; margin: .8rem 0 .3rem; }
.store-pick { font-weight: bold; font-size: 1.1rem; display: block; }
select, input { font-size: 1.1rem; padding: .5rem; border: 3px solid var(--line); border-radius: 8px; background: #fff; color: #000; }
select { width: 100%; margin-top: .3rem; }
.store-info { margin: .3rem 0 1rem; }
.big-label { font-weight: bold; display: block; margin-bottom: .3rem; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row input { flex: 1 1 260px; }
.btn { font-size: 1rem; font-weight: bold; padding: .6rem 1rem; min-height: 56px; border: 3px solid var(--line); border-radius: 10px; background: #f2f2f2; color: #000; cursor: pointer; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { background: #fff; color: #a00000; border-color: #a00000; }
.btn.small { min-height: 48px; padding: .3rem .6rem; }
.btn:focus-visible, .chip:focus-visible, .check:focus-visible, .info:focus-visible { outline: 4px solid #ff9900; outline-offset: 2px; }
details { margin: .8rem 0; }
summary.btn { display: inline-block; list-style: none; }
summary::-webkit-details-marker { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-size: 1rem; padding: .5rem .8rem; min-height: 52px; border: 2px solid var(--line); border-radius: 999px; background: #fff; color: #000; cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: .4rem; }
.chip img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 6px; }
.chip.added { background: #c8f7c5; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
ul { list-style: none; padding: 0; margin: 0; }
.item { display: flex; align-items: center; gap: .7rem; padding: .5rem .3rem; border-bottom: 2px solid #ccc; }
.check { flex: 0 0 64px; width: 64px; height: 64px; border: 4px solid #000; border-radius: 8px; background: #fff; font-size: 2.4rem; line-height: 1; color: #0a6b00; cursor: pointer; }
.info { flex: 1; text-align: left; background: none; border: none; font: inherit; color: inherit; cursor: pointer; padding: .2rem; }
.name { display: block; font-size: 1.3rem; font-weight: bold; }
.qty { font-weight: normal; }
.where { display: block; font-size: 1rem; }
.where.missing { color: #6b2a00; text-decoration: underline; }
.item.done .name { text-decoration: line-through; color: #555; }
.item.done .photo { opacity: .45; }
.empty { font-size: 1.2rem; padding: 1rem; background: var(--soft); border-radius: 10px; }
dialog { border: 4px solid #000; border-radius: 12px; max-width: 600px; width: 95%; font-size: 1.1rem; }
dialog label { display: block; font-weight: bold; margin: .6rem 0; }
dialog input { width: 100%; margin-top: .2rem; }
dialog::backdrop { background: rgba(0,0,0,.5); }
#orderList li { display: flex; align-items: center; gap: .5rem; margin: .3rem 0; }
#orderList li span { flex: 1; font-weight: bold; }
.hint { font-size: .9rem; }
footer { margin-top: 2rem; border-top: 2px solid #ccc; padding-top: 1rem; }

.home-line { margin: .2rem 0 .6rem; }
.photo-btn { background: none; border: none; padding: 0; cursor: pointer; flex: 0 0 auto; }
.photo { width: 84px; height: 84px; object-fit: contain; background: #fff; border: 2px solid #bbb; border-radius: 8px; display: block; }
.photo.big { width: 160px; height: 160px; }
.nophoto { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: .75rem; font-weight: bold; color: #333; background: #f4f4f4; border-style: dashed; }
.photo.big.nophoto { font-size: 1rem; }
.photo-edit { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.photo-btns { display: flex; flex-direction: column; gap: .4rem; }
.photo-btns .btn { display: inline-flex; align-items: center; margin: 0; }
.pline { display: block; margin-top: .2rem; }
.badge { display: inline-block; background: #0a5c0a; color: #fff; font-weight: bold; font-size: .95rem; padding: .15rem .5rem; border-radius: 6px; }
.price.none { font-size: .9rem; color: #444; }
.price.note { font-size: .9rem; }
fieldset { border: 2px solid #999; border-radius: 8px; margin: .6rem 0; }
fieldset label { font-weight: bold; }
fieldset input[type=number] { width: 8em; margin-left: .3rem; }
fieldset .hint { display: block; font-weight: normal; }
label.chk { display: block; font-weight: bold; margin: .5rem 0; }
label.chk input { width: 28px; height: 28px; vertical-align: middle; }
dialog select { width: 100%; }
.print-only { display: none; }

/* quantity box grid */
.qgrid-wrap { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.qgrid { display: grid; gap: 4px; }
.qgrid.cols2 { grid-template-columns: repeat(2, 48px); }
.qgrid.cols3 { grid-template-columns: repeat(3, 48px); }
.qbox { width: 48px; height: 48px; border: 4px solid #000; border-radius: 6px; background: #fff; font-size: 1.6rem; line-height: 1; color: #0a6b00; cursor: pointer; padding: 0; }
.qbox.on { background: #d9f5d6; }
.qall { min-height: 44px; min-width: 100px; font-size: .85rem; font-weight: bold; border: 3px solid #000; border-radius: 8px; background: #f2f2f2; color: #000; cursor: pointer; }
.qcount { font-size: .8rem; font-weight: bold; }
.qbox:focus-visible, .qall:focus-visible { outline: 4px solid #ff9900; outline-offset: 2px; }


/* help, recipe, notes, own stores */
.store-btns { margin: 0 0 .6rem; }
.help { margin: .4rem 0; }
.help-body, .recipe-body { border: 3px solid var(--accent); border-radius: 12px; padding: .6rem 1rem 1rem; margin-top: .5rem; background: #f4f8ff; }
.steps { padding-left: 1.6rem; margin: .4rem 0; }
.steps li { margin: .5rem 0; font-size: 1.05rem; }
textarea { width: 100%; font-size: 1.1rem; font-family: inherit; padding: .5rem; border: 3px solid var(--line); border-radius: 8px; margin-bottom: .5rem; }
.recipe-msg { font-size: 1.05rem; font-weight: bold; color: #0a5c0a; margin: .5rem 0 0; }
.dline { display: block; font-size: 1rem; margin-top: .15rem; background: var(--soft); border-radius: 6px; padding: .1rem .4rem; overflow-wrap: anywhere; }
.empty p { margin: .3rem 0; }
.eprices-box { margin: .6rem 0; }
.eprices-box summary.btn { display: inline-flex; align-items: center; }
.info { min-width: 0; overflow-wrap: anywhere; }
.where.missing { color: #444; }
h2.noloc { background: #555; }

/* phone: items that need several boxes put the boxes on their own line, so the name keeps full width */
@media (max-width: 600px) {
  html { font-size: 19px; }
  body { padding: 10px; }
  h1 { font-size: 1.6rem; }
  .item { flex-wrap: wrap; gap: .5rem; }
  .photo { width: 68px; height: 68px; }
  .item.multi .info { flex: 1 1 0; }
  .item.multi .qgrid-wrap { order: 3; flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .6rem; padding-left: .2rem; }
  .item.multi .qgrid.cols3 { grid-template-columns: repeat(3, 48px); }
  .item.multi .qgrid.cols2 { grid-template-columns: repeat(2, 48px); }
  .check { flex: 0 0 56px; width: 56px; height: 56px; }
  .toolbar .btn { flex: 1 1 auto; }
}

@media print {
  @page { size: letter; margin: 0.45in; }
  html { font-size: 15pt; }
  body { max-width: none; padding: 0; }
  .no-print, #list, dialog { display: none !important; }
  .print-only { display: block !important; }
  .print-head h1 { font-size: 22pt; margin: 0; }
  .print-head p { margin: 0 0 8pt; font-size: 11pt; }
  #printList.two-col { column-count: 2; column-gap: 0.35in; }
  .pgroup { break-inside: avoid-column; margin-bottom: 6pt; }
  .pgroup h2 { font-size: 13pt; background: none; color: #000; border-bottom: 2pt solid #000; border-radius: 0; padding: 0 0 2pt; margin: 6pt 0 3pt; }
  .prow { display: flex; align-items: center; gap: 8pt; padding: 2pt 0; break-inside: avoid; }
  .pbox { flex: 0 0 20pt; width: 20pt; height: 20pt; border: 2.5pt solid #000; border-radius: 3pt; }
  .pcol { flex: 0 0 52pt; display: flex; justify-content: center; }
  .pgrid { display: grid; gap: 3pt; flex: 0 0 auto; }
  .pgrid.cols2 { grid-template-columns: repeat(2, 15pt); }
  .pgrid.cols3 { grid-template-columns: repeat(3, 15pt); }
  .pbox.sm { width: 15pt; height: 15pt; border-width: 2pt; border-radius: 2pt; }
  .pphoto { width: 0.5in; height: 0.5in; object-fit: contain; flex: 0 0 0.5in; }
  .pphoto.nophoto { border: 1pt dashed #999; font-size: 6pt; display: flex; align-items: center; justify-content: center; text-align: center; }
  .pname { font-size: 16pt; font-weight: bold; }
  .pname small { display: block; font-weight: normal; font-size: 10pt; }
  .pline-blank { flex: 1; border-bottom: 1pt solid #000; height: 18pt; }
  .pempty { font-size: 12pt; }
}
