:root{
  --bg:#E9F1F4; --surface:#FFFFFF; --surface-2:#F2F8FB; --ink:#16324A; --muted:#5B7083; --muted-2:#3E5466;
  --line:#C9D8E0; --chip:#DCE8EE; --accent:#1F5F8B; --accent-ink:#FFFFFF;
  --ok:#2A7352; --ok-bg:#E6F2EC; --ok-line:#B9DCC9; --soon:#8A5A10; --soon-bg:#FBF1DE; --late:#A3321F; --late-bg:#F8E3DF;
  --scan-bg:#0B1620; --scan-surface:#172836; --scan-ink:#E3EEF4; --scan-muted:#93A8B8;
  --display:"Barlow Condensed","Arial Narrow",system-ui,sans-serif;
  --text:"Atkinson Hyperlegible",-apple-system,system-ui,"Segoe UI",sans-serif;
  --tabbar:86px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root{
    --bg:#0F1C26; --surface:#172836; --surface-2:#1C3142; --ink:#E3EEF4; --muted:#93A8B8; --muted-2:#B3C4D1;
    --line:#2A3F50; --chip:#22394A; --accent:#6FB3E0; --accent-ink:#0F1C26;
    --ok:#6CC59B; --ok-bg:#173226; --ok-line:#2C5A44; --soon:#E8B35A; --soon-bg:#33291A; --late:#F08A7A; --late-bg:#3A201C;
    color-scheme:dark;
  }
}
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink)}
body{font:16px/1.4 var(--text);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
[hidden]{display:none !important}
.sr{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

.page{max-width:640px;margin:0 auto;padding:calc(env(safe-area-inset-top,0px) + 20px) 16px calc(var(--tabbar) + env(safe-area-inset-bottom,0px) + 24px)}
.page.has-footer{padding-bottom:calc(var(--tabbar) + env(safe-area-inset-bottom,0px) + 96px)}
h1{font:700 38px/1 var(--display);margin:0 0 4px;letter-spacing:.01em}
h2{font:700 22px/1.1 var(--display);margin:22px 0 8px}
h3{font:600 20px/1.1 var(--display);margin:0}
.sub{color:var(--muted);margin:0 0 16px}
.muted{color:var(--muted)}
.small{font-size:14px}
.stack{display:flex;flex-direction:column;gap:12px}

.card{background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.card.pad{padding:14px 16px}
.empty{color:var(--muted);padding:16px;margin:0}

.tag{flex:none;min-width:58px;height:34px;padding:0 6px;display:inline-flex;align-items:center;justify-content:center;
  border:2px solid var(--ink);border-radius:6px;background:var(--surface);font:700 20px/1 var(--display);letter-spacing:.04em}
.tag.lg{min-width:78px;height:44px;font-size:26px}
.tag.sm{min-width:52px;height:30px;font-size:18px}

.row{display:flex;align-items:center;gap:12px;padding:11px 14px;width:100%;text-align:left;background:none;border:0;border-bottom:1px solid var(--line);color:inherit;text-decoration:none}
.row:last-child{border-bottom:0}
button.row:active,label.row:active{background:var(--chip)}
.row .what{flex:1;min-width:0}
.row .what b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row .meta{color:var(--muted);font-size:14px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.has-footer .toast{bottom:calc(var(--tabbar) + env(safe-area-inset-bottom,0px) + 86px)}
.due{font-size:14px;font-weight:700;white-space:nowrap;text-align:right}
.due.ok{color:var(--ok)} .due.soon{color:var(--soon)} .due.late{color:var(--late)}
.row.checked{background:var(--surface-2)}
.row input[type=checkbox]{width:24px;height:24px;accent-color:var(--accent);margin:0;flex:none}

.btn{display:flex;align-items:center;justify-content:center;gap:10px;min-height:52px;padding:0 18px;border:0;border-radius:14px;
  background:var(--accent);color:var(--accent-ink);font-weight:700;font-size:17px;text-decoration:none;width:100%}
.btn.ghost{background:var(--surface);color:var(--accent);border:2px solid var(--accent)}
.btn.plain{background:var(--surface);color:var(--ink);border:2px solid var(--line)}
.btn.danger{background:var(--late);color:#fff}
.btn.big{min-height:76px;font-size:22px;border-radius:16px}
.btn.auto{width:auto}
.btn:disabled{opacity:.5;cursor:default}
.link{background:none;border:0;padding:8px 0;color:var(--accent);font-weight:700;text-decoration:none;display:inline-flex;align-items:center;gap:8px;min-height:44px}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}

.seg{display:grid;gap:4px;background:var(--chip);padding:4px;border-radius:12px}
.seg button{height:40px;border:0;border-radius:9px;background:transparent;color:var(--muted-2)}
.seg button[aria-pressed=true]{background:var(--surface);color:var(--ink);font-weight:700}
.pick{border:2px solid var(--line);background:var(--surface);border-radius:10px;min-height:46px;font-weight:700;padding:0 12px}
.pick[aria-pressed=true]{border-color:var(--accent);background:var(--accent);color:var(--accent-ink)}
.pick.num{font:700 22px/1 var(--display)}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{height:38px;padding:0 14px;border:2px solid var(--line);background:var(--surface);border-radius:999px;font-weight:700;font-size:15px}
.chip[aria-pressed=true]{border-color:var(--accent);background:var(--accent);color:var(--accent-ink)}
.chip.soft{height:34px;border-width:1px;font-weight:400}

.lbl{display:block;font-weight:700;margin:14px 0 6px}
.field{width:100%;padding:12px;border-radius:10px;border:1px solid var(--line);background:var(--surface);min-height:48px}
.field:focus{border-color:var(--accent)}
.search{width:100%;padding:12px 14px;border-radius:10px;border:1px solid var(--line);background:var(--surface);min-height:48px}
.hint{color:var(--muted);font-size:14px;margin:6px 0 0}
.note{border-radius:12px;padding:12px 14px;display:flex;gap:10px;align-items:flex-start;font-size:15px}
.note.warn{background:var(--soon-bg)} .note.info{background:var(--chip)} .note.ok{background:var(--ok-bg)}
.note svg{flex:none;margin-top:1px}
.facts{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:2px 16px}
.facts div{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--line)}
.facts div:last-child{border-bottom:0}
.facts span:first-child{color:var(--muted)}

/* freezer drawers */
.drawer-head{width:100%;border:0;background:var(--surface);padding:12px 16px;display:flex;align-items:center;gap:10px;text-align:left;border-bottom:1px solid var(--line)}
.drawer-head.open{background:var(--chip)}
.drawer-head b{font:700 20px/1 var(--display);flex:1}
.drawer-last .drawer-head:last-child{border-bottom:0}

/* tab bar */
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:10;background:var(--surface);border-top:1px solid var(--line);
  height:calc(var(--tabbar) + env(safe-area-inset-bottom,0px));padding:8px 0 env(safe-area-inset-bottom,0px);
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:start}
.tabbar button{border:0;background:none;display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--muted);font-size:12px;padding:0}
.tabbar button[aria-current=page]{color:var(--accent);font-weight:700}
.tabbar .scan{justify-self:center;margin-top:-28px;width:64px;height:64px;border-radius:32px;background:var(--accent);color:var(--accent-ink);
  border:4px solid var(--bg);display:flex;align-items:center;justify-content:center}
.footerbar{position:fixed;left:0;right:0;bottom:calc(var(--tabbar) + env(safe-area-inset-bottom,0px));z-index:9;background:var(--surface);
  border-top:1px solid var(--line);padding:10px 16px;display:flex;align-items:center;gap:12px}
.footerbar .btn{width:auto}

/* sheets */
.scrim{position:fixed;inset:0;z-index:30;background:rgba(5,12,18,.55);display:flex;align-items:flex-end;justify-content:center}
.sheet{background:var(--bg);width:100%;max-width:560px;max-height:92vh;overflow:auto;border-radius:18px 18px 0 0;
  padding:18px 18px calc(24px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:12px}
@media (min-width:640px){.scrim{align-items:center}.sheet{border-radius:18px}}
@media (prefers-reduced-motion:no-preference){.sheet{animation:up .18s ease-out}@keyframes up{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}}
.sheet-top{display:flex;align-items:center;gap:12px}
.x{margin-left:auto;width:44px;height:44px;border:0;background:none;color:var(--muted);font-size:28px;line-height:1;flex:none}

/* full-screen overlays (scanner, paklijst, controle) */
.overlay{position:fixed;inset:0;z-index:20;background:var(--scan-bg);color:var(--scan-ink);display:flex;flex-direction:column;overflow:auto}
.overlay.light{background:var(--bg);color:var(--ink)}
.ov-top{padding:calc(env(safe-area-inset-top,0px) + 12px) 16px 0;display:flex;align-items:center;gap:12px}
.ov-top .back{border:0;background:none;color:inherit;font-weight:700;display:flex;align-items:center;gap:6px;min-height:44px;padding:0}
.lampbtn{margin-left:auto;height:44px;padding:0 14px;border:0;border-radius:22px;background:rgba(255,255,255,.14);color:#fff;font-weight:700;display:flex;align-items:center;gap:6px}
.lampbtn[aria-pressed=true]{background:#F2C14E;color:#16324A}
.active-drawer{margin:12px 16px 0;background:#1F5F8B;color:#fff;border-radius:14px;padding:10px 12px 10px 14px;display:flex;align-items:center;gap:12px}
.active-drawer b{font:700 22px/1.1 var(--display);display:block}
.active-drawer button{width:44px;height:44px;border:0;border-radius:10px;background:rgba(255,255,255,.16);color:#fff;font-size:22px;flex:none}
.reader-wrap{margin:12px 16px 0;border-radius:16px;overflow:hidden;background:#000;position:relative;min-height:240px}
.reader-wrap.small{min-height:170px;max-height:200px}
.reader-wrap video{width:100% !important;height:auto !important;display:block;object-fit:cover}
.reader-msg{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px;color:var(--scan-muted);font-size:15px}
.scan-hint{text-align:center;color:#C7D6E0;font-size:15px;margin:10px 16px 0}
.recent{margin-top:auto;background:var(--scan-surface);border-top:1px solid #2A3F50;padding:14px 16px calc(24px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:10px}
.recent .tag{border-color:var(--scan-ink);background:transparent;color:var(--scan-ink)}
.recent .meta{color:var(--scan-muted)}
.ok-flash{animation:okf .6s ease-out}
@keyframes okf{from{box-shadow:inset 0 0 0 6px #6CC59B}to{box-shadow:inset 0 0 0 0 transparent}}

.picklist .group{color:var(--muted);font-size:14px;font-weight:700;margin:6px 0 -4px}
.pickitem{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 14px;display:flex;align-items:center;gap:12px}
.pickitem.done{background:var(--ok-bg);border-color:var(--ok-line)}
.dot{width:26px;height:26px;border-radius:13px;border:2px solid var(--line);flex:none;display:flex;align-items:center;justify-content:center}
.pickitem.done .dot{background:var(--ok);border-color:var(--ok)}
.progress{height:8px;border-radius:999px;background:var(--line);overflow:hidden}
.progress span{display:block;height:8px;background:var(--ok)}

.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--tabbar) + env(safe-area-inset-bottom,0px) + 14px);z-index:50;
  background:var(--ink);color:var(--bg);padding:12px 16px;border-radius:12px;font-weight:700;display:flex;gap:14px;align-items:center;max-width:calc(100% - 32px)}
.toast button{background:none;border:0;color:var(--bg);text-decoration:underline;font-weight:700;white-space:nowrap}

.sheetgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;padding:6px;background:#fff;border:1px solid var(--line);border-radius:4px;width:150px;flex:none}
.sheetgrid button{height:22px;border-radius:2px;padding:0;font:700 11px/1 var(--display);border:1px dashed #9BB3C2;background:#fff;color:#3E5466}
.sheetgrid button.used{border:0;background:#C9D8E0}
.sheetgrid button.print{border:0;background:#1F5F8B;color:#fff}
.stepper{display:flex;align-items:center;gap:12px}
.stepper button{width:44px;height:44px;border-radius:10px;border:2px solid var(--accent);background:var(--surface);color:var(--accent);font-weight:700;font-size:22px}
.stepper button:disabled{border-color:var(--line);color:var(--muted)}
.stepper span{width:40px;text-align:center;font:700 26px/1 var(--display)}
.listrow{display:flex;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid var(--line);background:none;border-left:0;border-right:0;border-top:0;width:100%;text-align:left;color:inherit}
.listrow:last-child{border-bottom:0}
.listrow .ic{width:34px;height:34px;border-radius:8px;background:var(--chip);display:flex;align-items:center;justify-content:center;color:var(--accent);flex:none;font:700 16px var(--display)}
.listrow .what{flex:1}
.listrow .what b{display:block}
.badge{background:var(--soon-bg);color:var(--soon);font-size:13px;font-weight:700;padding:3px 8px;border-radius:999px;white-space:nowrap}
.demo-banner{background:var(--soon-bg);color:var(--ink);font-size:14px;padding:8px 12px;border-radius:10px;margin-bottom:12px}
.steps{counter-reset:s;display:flex;flex-direction:column;gap:10px;margin:0;padding:0;list-style:none}
.steps li{display:flex;gap:12px;align-items:flex-start}
.steps li::before{counter-increment:s;content:counter(s);flex:none;width:30px;height:30px;border-radius:15px;background:var(--accent);color:var(--accent-ink);display:flex;align-items:center;justify-content:center;font:700 18px var(--display)}
.steps li.done::before{content:"✓";background:var(--ok)}
.log{font-size:14px}
.log .row{padding:9px 14px}
