:root { color-scheme:light; --ink:#20382d; --muted:#52645a; --green:#246242; --pale:#edf5ef; --line:#cedbd1; }
* { box-sizing:border-box; }
body { margin:0; background:#f6f8f6; color:var(--ink); font:16px/1.55 system-ui,-apple-system,"Segoe UI",sans-serif; }
header,main,footer { max-width:1120px; margin:auto; padding:24px 32px; }
header { padding-top:32px; padding-bottom:0; }
nav,.controls { display:flex; flex-wrap:wrap; align-items:center; gap:12px 20px; }
nav { margin-bottom:24px; }
a,summary { color:var(--green); text-underline-offset:3px; }
h1 { font-size:2.25rem; line-height:1.15; margin:0 0 12px; }
h2 { font-size:1.4rem; line-height:1.3; }
h3 { font-size:1.08rem; margin:0; }
p { margin:12px 0; }
button,input { font:inherit; color:var(--ink); border:1px solid #849e8d; border-radius:5px; background:white; min-height:44px; padding:9px 14px; }
button,summary { cursor:pointer; }
button:hover { background:var(--pale); }
button:disabled { color:var(--muted); background:#e5ebe7; cursor:not-allowed; }
button[aria-pressed="true"] { background:var(--green); color:white; border-color:var(--green); }
:focus-visible { outline:3px solid #a14f0b; outline-offset:4px; }
label { font-weight:650; }
.controls label { display:flex; flex-direction:column; gap:6px; max-width:100%; }
input[type="month"] { min-width:0; max-width:100%; }
.small { color:var(--muted); font-size:.88rem; }
summary { padding:10px 0; font-weight:650; }
.warning { border-left:3px solid #a14f0b; padding-left:12px; }
.week-buttons { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); margin:16px 0 12px; gap:6px; }
.week-buttons button { min-width:0; min-height:60px; padding:6px 4px; }
.week-buttons button span { display:block; white-space:nowrap; }
.week-buttons button span + span { font-size:.78rem; }
.list-actions { display:flex; justify-content:flex-end; }
.groceries { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px 32px; }
.grocery-group { border-top:1px solid var(--line); padding-top:12px; min-width:0; }
.grocery-list { list-style:none; padding:0; margin:8px 0; }
.grocery-list label { display:flex; align-items:flex-start; gap:10px; padding:9px 0; font-size:.94rem; font-weight:400; cursor:pointer; overflow-wrap:anywhere; }
input[type="checkbox"] { width:19px; height:19px; min-height:0; padding:0; flex-shrink:0; margin:3px 0 0; accent-color:var(--green); }
input:checked + span { text-decoration:line-through; color:var(--muted); }
[hidden] { display:none !important; }
footer { border-top:1px solid var(--line); color:var(--muted); font-size:.8rem; }
.skip { position:absolute; top:-80px; left:12px; background:white; padding:8px; }
.skip:focus { top:8px; }
@media(max-width:650px) {
  header,main,footer { padding-left:18px; padding-right:18px; }
  h1 { font-size:1.85rem; }
  .groceries { grid-template-columns:minmax(0,1fr); gap:16px; }
  .list-actions { justify-content:flex-start; }
  .week-buttons { gap:4px; }
  .week-buttons button { font-size:.82rem; }
  .week-buttons button span + span { font-size:.65rem; }
}
@page { margin:12mm; }
@media print {
  body { background:white; color:#111; font-size:10pt; }
  header,main,footer { max-width:none; padding:0; }
  nav,.skip,.controls,.week-buttons,.list-actions,#storage-status { display:none; }
  header h1 { font-size:20pt; }
  header > p { margin:6px 0; }
  details { font-size:8pt; line-height:1.3; }
  details > summary { display:none; }
  details::details-content { display:block; content-visibility:visible; }
  details > p { display:block; margin:6px 0; }
  .grocery-week[hidden] { display:block !important; }
  .grocery-week { break-before:page; }
  .grocery-week:first-child { break-before:auto; }
  .grocery-week h2 { font-size:13pt; margin:12px 0 4px; }
  .grocery-week h3 { font-size:10pt; }
  .grocery-week > p { margin:4px 0 10px; }
  .groceries { display:block; columns:2; column-gap:24px; }
  .grocery-group { break-inside:avoid; margin-bottom:10px; padding-top:8px; }
  .grocery-list { margin:6px 0; }
  .grocery-list label { padding:3px 0; font-size:9pt; line-height:1.35; }
  input[type="checkbox"] { width:12px; height:12px; margin-top:2px; }
  input:checked + span { color:#111; }
  footer { margin-top:18px; }
}
