:root {
  --bg: #faf6ef; --card: #fff; --ink: #2b2b26; --soft: #77766b; --line: #e9e2d3;
  --green: #4a6b4f; --on-green: #fff; --green-d: color-mix(in srgb, var(--green) 75%, black); --tint: color-mix(in srgb, var(--green) 11%, white);
  --font: -apple-system, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); padding-bottom: 84px; }
header { background: var(--green); color: var(--on-green); padding: 16px 16px 14px; position: sticky; top: 0; z-index: 5; }
#brand { font-weight: 700; font-size: 18px; letter-spacing: .2px; }
#week { opacity: .85; font-size: 14px; }
main { max-width: 640px; margin: 0 auto; padding: 14px 16px; }
.note { color: var(--soft); font-size: 14px; margin: 4px 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.card.muted { background: #f3efe6; }
.card h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--green); }
button { font: inherit; cursor: pointer; }
.meal { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 0; color: inherit; }
.meal:first-of-type { border-top: 0; }
.mt { width: 78px; font-size: 13px; color: var(--soft); flex: none; }
.mn { flex: 1; font-weight: 600; }
.chev { color: var(--soft); font-size: 20px; }
.gl-list { list-style: none; margin: 0; padding: 0; }
.g { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.g:first-child { border-top: 0; }
.gl { display: flex; gap: 12px; align-items: flex-start; flex: 1; cursor: pointer; }
.gl input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--green); flex: none; }
.gt small { display: block; color: var(--soft); font-size: 12px; }
.qty { font-weight: 700; }
.g.done .gt, .prep.done b { text-decoration: line-through; color: var(--soft); }
.tag { font-style: normal; font-size: 11px; background: var(--tint); color: var(--green-d); border-radius: 20px; padding: 1px 8px; margin-left: 4px; white-space: nowrap; }
.pill { flex: none; border: 1px solid var(--green); color: var(--green); background: #fff; border-radius: 20px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.pill:active { background: var(--tint); }
.stepper { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; margin-bottom: 8px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--green); background: #fff; color: var(--green); font-size: 18px; line-height: 1; }
.progress { height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; }
.progress div { height: 100%; background: var(--green); transition: width .25s; }
.pcount { font-size: 13px; color: var(--soft); margin: 4px 0 14px; }
.toggle { width: 100%; background: none; border: 1px dashed var(--soft); border-radius: 12px; padding: 10px; color: var(--soft); margin-bottom: 12px; }
.link { background: none; border: 0; color: var(--soft); text-decoration: underline; display: block; margin: 8px auto; font-size: 14px; }
.hero { background: var(--tint); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.hero h2 { margin: 0; } .hero p { margin: 2px 0 8px; color: var(--soft); }
.prep ol { margin: 8px 0 0 34px; padding: 0; color: var(--soft); font-size: 14px; }
nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
nav button { flex: 1; background: none; border: 0; padding: 14px 4px; font-weight: 600; font-size: 14px; color: var(--soft); border-top: 3px solid transparent; }
nav button.on { color: var(--green); border-top-color: var(--green); }
dialog { border: 0; border-radius: 16px; width: min(560px, calc(100% - 24px)); max-height: 88vh; padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { margin: 0; } dialog h4 { margin: 16px 0 4px; color: var(--green); }
dialog ul, dialog ol { padding-left: 20px; margin: 0; } dialog li { margin: 4px 0; }
.meta { color: var(--soft); margin: 2px 0; }
.close { margin-top: 16px; width: 100%; background: var(--green); color: var(--on-green); border: 0; border-radius: 12px; padding: 12px; font-weight: 600; }
.mac { display: block; font-weight: 400; font-size: 12px; color: var(--soft); margin-top: 2px; }
.daytotal { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; color: var(--green); }
.macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 2px; }
.macros div { background: var(--tint); border-radius: 10px; padding: 8px 4px; text-align: center; }
.macros b { display: block; font-size: 17px; } .macros span { font-size: 11px; color: var(--soft); }
#brand { display: flex; align-items: center; gap: 10px; }
.logo { height: 30px; max-width: 120px; object-fit: contain; }
.actions { display: flex; gap: 8px; margin-bottom: 12px; }
#toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); background: #2b2b26; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 20; max-width: 90%; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.notes li { margin: 4px 0; }
@media print {
  header, nav, .actions, .pill, .toggle, .link, .stepper, .note, .progress, .pcount, dialog { display: none !important; }
  body { background: #fff; padding: 0; } main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0 0 8px; break-inside: avoid; }
  .g { border-top: 0; padding: 3px 0; } .gl input { width: 14px; height: 14px; }
}
#gate { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.gatebox { width: min(420px, 100%); text-align: center; }
.gatebox h2 { margin: 8px 0 4px; } .gatebox .sub { color: var(--soft); margin: 0 0 16px; font-size: 15px; }
.gatebox input[type=text], #gcode { width: 100%; font: inherit; font-size: 18px; text-align: center; padding: 12px; border: 1px solid #d9d2c1; border-radius: 12px; margin-bottom: 14px; background: #fff; }
.logo.big { height: 90px; max-width: 220px; margin: 0 auto 6px; display: block; }
.consent { display: flex; gap: 10px; text-align: left; font-size: 14px; color: var(--ink); margin: 6px 0 12px; }
.consent input { width: 22px; height: 22px; flex: none; accent-color: var(--green); margin-top: 2px; }
.consent a { color: var(--green); }
.bad { color: #b3402a; font-weight: 600; font-size: 14px; min-height: 18px; margin: 0 0 8px; }
body.locked > header, body.locked > main, body.locked > nav { visibility: hidden; }
#legal h4 { margin: 16px 0 4px; color: var(--green); } #legal p { margin: 6px 0; font-size: 15px; }
dialog { overflow-y: auto; }
.weekpick { margin-bottom: 10px; font-size: 14px; color: var(--soft); }
.weekpick select { font: inherit; padding: 7px 10px; border: 1px solid #d9d2c1; border-radius: 10px; background: #fff; color: var(--ink); max-width: 100%; }
.pastbanner { background: #fff4e0; border: 1px solid #f0d9a8; border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }
.pastbanner .link { display: inline; margin: 0 0 0 6px; }
@media print { .weekpick, .pastbanner { display: none !important; } }
header.light { background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line); }
header.light #week { opacity: .7; }
.logo.solo { height: auto; max-height: 60px; max-width: min(300px, 80vw); }
