:root{--g:#0f5132;--g2:#198754;--bg:#f6f7f5;--card:#fff;--ink:#1d2320;--mut:#66706b;--line:#e3e6e3;--sale:#c0392b}
*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}
body{margin:0;font:16px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--ink);padding-bottom:84px}
.top{background:var(--g);color:#fff;padding:18px 16px 14px;padding-top:max(18px,env(safe-area-inset-top))}
.top h1{margin:0;font-size:22px;letter-spacing:-.2px}.sub{margin:4px 0 0;opacity:.85;font-size:14px}
main{max-width:720px;margin:0 auto;padding:0 12px}
.search{position:sticky;top:0;z-index:5;background:var(--bg);padding:12px 0 8px}
#q{width:100%;font-size:17px;padding:13px 14px;border:1.5px solid var(--line);border-radius:12px;background:#fff;outline:none}
#q:focus{border-color:var(--g2)}
.chips{display:flex;gap:8px;overflow-x:auto;padding:10px 0 4px;scrollbar-width:none}.chips::-webkit-scrollbar{display:none}
.chip{flex:0 0 auto;border:1px solid var(--line);background:#fff;border-radius:999px;padding:7px 12px;font-size:14px;color:var(--ink)}
.chip.on{background:var(--g);border-color:var(--g);color:#fff}
.opt{display:block;font-size:14px;color:var(--mut);padding-top:4px}
.summary{background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px 14px;margin:8px 0}
.summary h2{font-size:15px;margin:0 0 8px}
.bar{display:flex;align-items:center;gap:8px;margin:5px 0;font-size:14px}.bar b{width:112px;flex:0 0 112px;font-weight:600;font-size:13.5px}
.bar span.f{height:10px;border-radius:5px;background:var(--g2)}.bar em{font-style:normal;color:var(--mut);font-size:13px;white-space:nowrap}
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:12px 12px 10px;margin:10px 0}
.card h3{font-size:16px;margin:0 0 2px;font-weight:600}
.meta{font-size:12.5px;color:var(--mut);margin-bottom:8px;display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.tag{display:inline-block;font-size:11.5px;border-radius:6px;padding:1px 6px;font-weight:600}
.tag.upc{background:#e7f3ec;color:var(--g)}.tag.name{background:#fff4d6;color:#8a6100}.tag.check{background:#fde8e6;color:var(--sale)}
.row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 10px;border-radius:10px;text-decoration:none;color:var(--ink);border:1px solid transparent}
.row+.row{margin-top:4px}
.row.best{background:#e9f6ee;border-color:#b7e0c6}
.row .st{font-weight:600;min-width:104px;font-size:15px}.row .nm{flex:1;font-size:12.5px;color:var(--mut);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row .pr{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:700}
.row .pr s{color:var(--mut);font-weight:400;font-size:12.5px;margin-right:4px}.row .deal{display:block;font-size:11.5px;color:var(--sale);font-weight:600}
.row.best .pr{color:var(--g)}
.save{font-size:13px;color:var(--g);margin:6px 2px 0;display:flex;justify-content:space-between;align-items:center}
.add{border:1px solid var(--g2);color:var(--g);background:#fff;border-radius:999px;padding:5px 12px;font-size:13.5px;font-weight:600}
.add.in{background:var(--g2);color:#fff}
.more{display:block;width:100%;margin:8px 0 18px;padding:13px;border-radius:12px;border:1px solid var(--line);background:#fff;font-size:15px;font-weight:600;color:var(--g)}
.empty{color:var(--mut);text-align:center;padding:30px 10px}
.note{font-size:14px;color:var(--mut);padding:8px 2px 24px}.note h2{font-size:15px;color:var(--ink)}
.listbar{position:fixed;left:0;right:0;bottom:0;padding:10px 12px;padding-bottom:max(10px,env(safe-area-inset-bottom));background:linear-gradient(transparent,var(--bg) 30%)}
.listbar button{display:block;width:100%;max-width:720px;margin:0 auto;padding:14px;border-radius:14px;border:0;background:var(--g);color:#fff;font-size:16px;font-weight:600;box-shadow:0 4px 14px rgba(0,0,0,.18)}
dialog{border:0;border-radius:16px;padding:0;width:min(680px,94vw);max-height:86vh}
dialog::backdrop{background:rgba(0,0,0,.4)}
.dlg{padding:14px}.dlghead{display:flex;justify-content:space-between;align-items:center}.dlghead h2{margin:0;font-size:18px}
.dlghead button{border:0;background:none;font-size:20px;padding:6px}
.tot{display:flex;justify-content:space-between;padding:10px;border-radius:10px;margin:4px 0;font-size:15px}
.tot.best{background:#e9f6ee;font-weight:700;color:var(--g)}.tot em{font-style:normal;color:var(--mut);font-size:12.5px}
.li{display:flex;justify-content:space-between;gap:8px;font-size:14px;padding:6px 0;border-bottom:1px solid var(--line)}
.li button{border:0;background:none;color:var(--sale);font-size:13px}
.link{border:0;background:none;color:var(--sale);padding:10px 0;font-size:14px}

.pic{display:flex;align-items:center;justify-content:center;height:150px;margin:-2px -2px 10px;background:#fff;border-radius:10px;overflow:hidden}
.pic img{max-width:100%;max-height:150px;width:auto;height:auto;object-fit:contain;display:block}
.pic .pvhit{position:relative;display:inline-block;line-height:0;max-width:100%;cursor:zoom-in;-webkit-tap-highlight-color:transparent}
.pic.none{background:#f1f3f1;border:1px dashed var(--line);height:72px}
.pic.none span{font-size:12.5px;color:var(--mut)}
@media (min-width:640px){.pic{height:180px}.pic img{max-height:180px}}
.note a{color:var(--g)}
.stores{margin:6px 0 0;padding-left:18px}.stores li{margin:2px 0}
a:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid #f2b705;outline-offset:2px}

.srow{display:flex;gap:8px}.srow #q{flex:1;min-width:0}
.scanbtn{flex:0 0 auto;display:flex;align-items:center;gap:6px;border:0;border-radius:12px;background:var(--g);color:#fff;font-size:16px;font-weight:600;padding:0 14px}
.opts{display:flex;gap:16px;flex-wrap:wrap}
.tag.one{background:#eef0ff;color:#3b4aa8}
.scanbox{position:relative;background:#000;border-radius:12px;overflow:hidden;aspect-ratio:4/3;margin-top:10px}
.scanbox video{width:100%;height:100%;object-fit:cover;display:block}
.scanline{position:absolute;left:8%;right:8%;top:50%;height:2px;background:#ff3b30;box-shadow:0 0 8px #ff3b30}
.scanmsg{margin:10px 0 6px;display:block;font-size:14px}
.photobtn{display:block;text-align:center;padding:12px;border:1px solid var(--line);border-radius:12px;color:var(--g);font-weight:600;font-size:15px}

/* v4: menu, logos, side drawer, sort, weekly order */
.tophead{display:flex;align-items:center;gap:10px}
.menubtn{flex:0 0 auto;display:flex;align-items:center;gap:5px;border:1px solid rgba(255,255,255,.45);background:rgba(255,255,255,.12);color:#fff;border-radius:10px;padding:6px 9px;font-size:14px;font-weight:600}
.logos{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:12px}
@media (min-width:560px){.logos{grid-template-columns:repeat(7,1fr)}}
.lgb{border:2px solid transparent;background:none;padding:0;border-radius:10px;cursor:pointer}
.lgb.on{border-color:#f2b705}
.lg{display:inline-flex;align-items:center;justify-content:center;border-radius:8px;overflow:hidden;vertical-align:middle;flex:0 0 auto}
.lgb .lg{display:flex;width:100%;height:40px;padding:4px 6px}
.lg img{max-width:100%;max-height:100%;object-fit:contain;display:block}
.lg.sm{width:40px;height:20px;padding:2px 3px;border-radius:5px;margin-right:6px;border:1px solid var(--line)}
.lg.all{background:var(--g);color:#fff;font-size:11px;font-weight:700}
.row .st{display:flex;align-items:center;min-width:132px}.row .st .sl{font-size:14px}
.row.sel{border-color:#f2b705;box-shadow:inset 0 0 0 1px #f2b705}
.unit{font-weight:600;color:var(--ink)}
.storepill{display:flex;align-items:center;gap:4px;margin-top:8px;background:#fff8e1;border:1px solid #f2d27a;border-radius:10px;padding:6px 8px;font-size:14px}
.storepill>span:not(.lg){flex:1}.storepill button{border:0;background:var(--g);color:#fff;border-radius:999px;padding:5px 10px;font-size:13px;font-weight:600}
.sortbar{display:flex;align-items:center;gap:6px;padding-top:8px;font-size:13px;color:var(--mut);overflow-x:auto;scrollbar-width:none}
.sortbar button{flex:0 0 auto;border:1px solid var(--line);background:#fff;border-radius:8px;padding:5px 9px;font-size:13px;color:var(--ink)}
.sortbar button.on{background:#e9f6ee;border-color:var(--g2);color:var(--g);font-weight:700}
.dwback{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:40}
.drawer{position:fixed;top:0;left:0;bottom:0;width:min(320px,86vw);background:#fff;z-index:41;transform:translateX(-105%);transition:transform .22s ease;overflow-y:auto;padding:14px 12px;padding-top:max(14px,env(safe-area-inset-top));box-shadow:4px 0 18px rgba(0,0,0,.2)}
.drawer.open{transform:none}
.dwhead{display:flex;justify-content:space-between;align-items:center}.dwhead h2{margin:0;font-size:18px}.dwhead button{border:0;background:none;font-size:20px;padding:6px}
.dws{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:1px solid var(--line);background:#fff;border-radius:12px;padding:8px;margin:6px 0;color:var(--ink)}
.dws .lg{width:84px;height:36px;padding:3px 5px;border:1px solid var(--line)}
.dws .lg.sm{width:84px;height:36px;margin:0;font-size:14px}
.dws b{display:block;font-size:15px}.dws em{display:block;font-style:normal;font-size:12.5px;color:var(--mut)}
.dws.on{border-color:var(--g2);background:#e9f6ee}
.dwlist{margin-top:14px;border-color:var(--g2)}
body.noscroll{overflow:hidden}
.wsum{background:#f3f8f5;border-radius:12px;padding:8px 10px;margin:6px 0}
.wsum .big{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:5px 0;font-size:14px}.wsum .big b{display:flex;align-items:center;font-size:15px;color:var(--g);white-space:nowrap}
.wsum .mix{border-top:1px solid var(--line)}
.lh{font-size:15px;margin:14px 0 4px}
.li{align-items:center}.lin{flex:1;min-width:0}.lin b{display:block;font-weight:600;font-size:14px}.lin .meta{margin:0}
.qty{display:flex;align-items:center;gap:4px}.qty button{width:32px;height:32px;border-radius:50%;border:1px solid var(--g2);background:#fff;color:var(--g);font-size:18px;font-weight:700;line-height:1;padding:0}.qty span{min-width:20px;text-align:center;font-weight:700}
.li .rm{color:var(--sale);font-size:16px;padding:6px}
.tot span:first-child{display:flex;align-items:center;flex-wrap:wrap}
.mixs{border-bottom:1px solid var(--line);padding-bottom:4px}.mixi{margin:0 10px 6px}
.listacts{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;align-items:center}
.listacts .wa{flex:1;border:0;background:#25d366;color:#fff;border-radius:12px;padding:12px;font-size:15px;font-weight:700}
.listacts .cp{flex:1;border:1px solid var(--g2);background:#fff;color:var(--g);border-radius:12px;padding:12px;font-size:15px;font-weight:700}
.storepill[hidden],.sortbar[hidden],.listacts[hidden],.dwback[hidden]{display:none}
.tot em{margin-left:4px}

/* photo viewer */
.pic{position:relative}
.zoomhint{position:absolute;right:3px;bottom:3px;width:24px;height:24px;border-radius:12px;background:rgba(0,0,0,.45);color:#fff;font-size:14px;line-height:24px;text-align:center;pointer-events:none}
.pic.none .zoomhint{display:none}
html.pvlock,html.pvlock body{overflow:hidden}
#pv{position:fixed;inset:0;z-index:1000;touch-action:none;overscroll-behavior:contain;background:rgba(10,12,10,1);display:none;flex-direction:column;color:#fff;height:100vh;height:100dvh}
#pv.on{display:flex}
.pvtop{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:calc(env(safe-area-inset-top) + 8px) 10px 6px 14px}
.pvhint{font-size:12px;color:#c9d1c9;line-height:1.3}
#pvx{flex:none;width:40px;height:40px;border-radius:20px;border:0;background:rgba(255,255,255,.16);color:#fff;font-size:20px;cursor:pointer}
.pvstage{flex:1 1 auto;min-height:38vh;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;touch-action:none;background:transparent;margin:0 8px}
#pvimg{max-width:100%;max-height:100%;background:#fff;border-radius:4px;touch-action:none;-webkit-user-drag:auto;object-fit:contain;transform-origin:center center;will-change:transform;-webkit-touch-callout:default;-webkit-user-select:auto;user-select:auto;display:block}
.pvacts{display:flex;gap:8px;padding:10px 8px 6px}
.pvacts button{touch-action:manipulation;flex:1;padding:11px 4px;border-radius:12px;border:0;background:rgba(255,255,255,.14);color:#fff;font-size:14.5px;font-weight:600;cursor:pointer}
.pvinfo{touch-action:pan-y;overscroll-behavior:contain;flex:0 1 auto;max-height:36vh;overflow:auto;background:#fff;color:#1a1d1a;border-radius:14px 14px 0 0;padding:12px 12px calc(env(safe-area-inset-bottom) + 12px);-webkit-overflow-scrolling:touch}
.pvinfo h3{margin:0 0 6px;font-size:16px;line-height:1.3;user-select:text;-webkit-user-select:text}
.pvinfo .meta{user-select:text;-webkit-user-select:text}
.pvcopytxt{display:block;width:100%;margin-top:10px;padding:11px;border-radius:12px;border:1px solid var(--line,#ddd);background:#f4f6f4;font-size:14.5px;font-weight:600;color:#1a1d1a;cursor:pointer}
.pvtoast{position:absolute;left:50%;bottom:calc(env(safe-area-inset-bottom) + 24px);transform:translateX(-50%) translateY(20px);background:rgba(20,22,20,.92);color:#fff;padding:10px 14px;border-radius:12px;font-size:14px;opacity:0;transition:all .2s;pointer-events:none;max-width:88vw;text-align:center}
.pvtoast.on{opacity:1;transform:translateX(-50%) translateY(0)}

.dwsec{border:1px solid var(--line);border-radius:12px;margin:8px 0;padding:2px 8px;background:#fafbfa}
.dwtog{display:flex;align-items:center;gap:10px;width:100%;border:0;background:none;padding:10px 2px;font-size:16px;font-weight:700;color:var(--ink);text-align:left}
.dwtog .pm{flex:0 0 28px;height:28px;border-radius:8px;background:var(--g);color:#fff;font-size:20px;line-height:27px;text-align:center;font-weight:700}
.dwtog .tl{flex:1 1 auto}.dwtog em{font-style:normal;font-weight:600;font-size:12.5px;color:var(--g);max-width:45%;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dwc{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;border:1px solid var(--line);background:#fff;border-radius:10px;padding:10px;margin:5px 0;color:var(--ink);font-size:15px}
.dwc b{font-weight:600}.dwc em{font-style:normal;font-size:12.5px;color:var(--mut)}
.dwc.on{border-color:var(--g2);background:#e9f6ee}
#dwstores[hidden],#dwcats[hidden]{display:none}

/* About screen */
.aboutdlg{width:100vw;max-width:680px;height:100%;max-height:100%;margin:0 auto;border-radius:0}
@media(min-width:700px){.aboutdlg{height:auto;max-height:90vh;border-radius:16px;margin:auto}}
.aboutdlg .dlg{padding:0}
.abhead{position:sticky;top:0;z-index:2;background:var(--g);color:#fff;padding:10px 8px;padding-top:max(10px,env(safe-area-inset-top))}
.abhead h2{color:#fff}.abhead button{color:#fff}
.abback{font-size:16px!important;font-weight:600}
.about{padding:14px 16px 28px;padding-bottom:max(28px,env(safe-area-inset-bottom));font-size:15px}
.about h3{font-size:16px;margin:20px 0 8px;color:var(--g)}
.abhero b{display:block;font-size:20px;margin-bottom:4px}.abhero span{color:var(--mut)}
.abstat{display:flex;gap:8px;margin:14px 0 10px}.abstat div{flex:1;background:#e9f6ee;border-radius:12px;padding:10px 6px;text-align:center}
.abstat b{display:block;font-size:19px;color:var(--g)}.abstat span{font-size:12.5px;color:var(--mut)}
.abupd{background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px 12px;margin:8px 0;font-size:14.5px}
.abmut{font-size:13px;color:var(--mut)}
.abhow{padding-left:0;list-style:none;margin:0}.abhow li{background:#fff;border:1px solid var(--line);border-radius:12px;padding:9px 12px;margin:6px 0;font-size:14.5px}
.abst{display:flex;gap:12px;align-items:flex-start;background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px 12px;margin:8px 0}
.abst .lg{flex:0 0 auto}
.abinfo{min-width:0;display:flex;flex-direction:column;gap:2px;font-size:14px}.abinfo b{font-size:15.5px}.abinfo em{font-style:normal;font-size:12.5px;color:var(--mut)}
.abinfo a{color:var(--g);text-decoration:none}
.ablinks{display:flex;gap:16px;flex-wrap:wrap;margin-top:2px}.ablinks a{font-weight:600}
.abnote{font-size:14px;color:var(--ink)}.abnote p{margin:6px 0}
.dwabout{margin-top:6px}
.abst .lg{width:68px;height:44px;padding:4px 6px;border:1px solid var(--line)}.abst .lg img{max-width:100%;max-height:100%;object-fit:contain}
.terms h4{font-size:15px;margin:14px 0 4px}.terms p{color:#2b322e}.abterms{margin:18px 0 0;text-align:center}.abterms a{color:var(--g);font-weight:600}.dwterms{margin-top:0}

/* ---- WIC / SNAP badges ---- */
.bdgs{position:absolute;left:4px;top:4px;display:flex;flex-direction:column;gap:3px;z-index:2;pointer-events:none}
.bdg{display:inline-block;font-size:10.5px;font-weight:800;letter-spacing:.3px;line-height:1;padding:3px 5px;border-radius:5px;color:#fff;vertical-align:middle}
.bdg small{font-size:8.5px;font-weight:700}
.bdg.wic{background:#1565c0}
.bdg.snap{background:#ef6c00}
.pic.none{position:relative}
.bline{margin:6px 0 8px;font-size:13px;line-height:1.7;color:#333}
.tagpill{background:#eef4ff;border-color:#b8cdf3}
.tagpill[hidden]{display:none}
.dwc .bdg{margin-right:2px}
/* ---- store hours ---- */
.ot{display:inline-block;font-size:11.5px;font-weight:700;padding:2px 7px;border-radius:999px;margin-right:6px}
.ot.op{background:#e3f5e9;color:#1b7a3a}
.ot.cl{background:#fdecea;color:#b3261e}
.otx{font-size:12px;color:var(--mut);margin-right:6px}
.dwst{margin:6px 0}
.dwst .dws{margin:0}
.dwh{display:flex;flex-wrap:wrap;align-items:center;gap:2px 4px;padding:4px 4px 2px 6px;font-size:12px;color:var(--mut)}
.dwh .dwt{margin-right:6px}
.dwh a{font-weight:600;font-size:12px;white-space:nowrap}
.abopen{margin-top:6px}
.hrs{border-collapse:collapse;margin-top:4px;font-size:12.5px;color:#333}
.hrs th{text-align:left;font-weight:600;padding:1px 10px 1px 0;white-space:nowrap;vertical-align:top}
.hrs td{padding:1px 0}
.hrs tr.td th,.hrs tr.td td{color:var(--g);font-weight:700}
div.hrs{font-size:12.5px;color:var(--mut);margin-top:4px}
/* ---- back to top ---- */
.totop{position:fixed;right:14px;bottom:calc(18px + env(safe-area-inset-bottom));width:46px;height:46px;border-radius:50%;border:0;background:var(--g);color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 14px rgba(0,0,0,.25);opacity:0;transform:translateY(12px) scale(.9);pointer-events:none;transition:opacity .2s,transform .2s,bottom .2s;z-index:40}
.totop.show{opacity:.95;transform:none;pointer-events:auto}
.totop.lift{bottom:calc(86px + env(safe-area-inset-bottom))}
#dwtags .dwc{flex-direction:column;align-items:flex-start;gap:2px}
#dwtags .dwc b{display:flex;align-items:center;gap:6px}

/* ===== brand, top tabs, watch, deals, watchlist, install, dark mode (v9) ===== */
.brand{display:flex;align-items:center;gap:8px;min-width:0}
.brand .mark{width:30px;height:30px;flex:0 0 30px;border-radius:7px;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.brand span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:380px){.top h1{font-size:19.5px}.brand .mark{width:27px;height:27px;flex-basis:27px}}
.toptabs{display:flex;gap:8px;margin-top:10px}
.toptabs button{flex:1;border:1px solid rgba(255,255,255,.4);background:rgba(255,255,255,.14);color:#fff;border-radius:11px;padding:9px 8px;font-size:14.5px;font-weight:700;display:flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap}
.toptabs .tn{background:#ffc83d;color:#0b4a2d;border-radius:999px;padding:1px 7px;font-size:12px;font-weight:800}
.toptabs .tn:empty,.toptabs .wcount:empty{display:none}
.toptabs .wcount{font-weight:600;opacity:.9}
.toptabs .tn.drop{background:#ff6b5b;color:#fff}
.card{position:relative}
.watch{position:absolute;top:10px;right:10px;z-index:3;border:1px solid var(--line);background:rgba(255,255,255,.94);color:#c2185b;border-radius:999px;padding:5px 10px;font-size:13px;font-weight:700;box-shadow:0 1px 4px rgba(0,0,0,.08);cursor:pointer}
.watch.on{background:#c2185b;border-color:#c2185b;color:#fff}
.watch.mini{position:static;flex:0 0 auto;width:36px;height:36px;padding:0;font-size:18px;line-height:1;box-shadow:none}
.watch.demo{position:static;display:inline-block;padding:1px 8px;font-size:12.5px;box-shadow:none}
.row{cursor:pointer;position:relative}
.row .ext{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:26px;height:26px;margin-right:-4px;border-radius:7px;color:var(--mut);text-decoration:none;font-size:14px;border:1px solid var(--line);background:var(--card)}
.row .drop{display:block;font-size:11.5px;color:#c2185b;font-weight:700}
.mgtoast{position:fixed;left:50%;bottom:calc(96px + env(safe-area-inset-bottom));transform:translateX(-50%) translateY(16px);background:rgba(20,24,22,.94);color:#fff;padding:10px 16px;border-radius:12px;font-size:14.5px;font-weight:600;opacity:0;transition:all .2s;pointer-events:none;z-index:1200;white-space:nowrap}
.mgtoast.on{opacity:1;transform:translateX(-50%)}
.xdlg .abhead{position:sticky;top:0;z-index:2;background:var(--card);padding:12px 14px;border-bottom:1px solid var(--line)}
.xbody{padding-top:10px}
.dtabs{display:flex;gap:6px;background:#eef1ee;border-radius:12px;padding:4px}
.dtabs button{flex:1;border:0;background:none;border-radius:9px;padding:9px 4px;font-size:14px;font-weight:700;color:var(--mut)}
.dtabs button.on{background:var(--card);color:var(--g);box-shadow:0 1px 3px rgba(0,0,0,.12)}
.dstores{display:flex;gap:6px;overflow-x:auto;padding:10px 0 4px;scrollbar-width:none}.dstores::-webkit-scrollbar{display:none}
.dstores button{flex:0 0 auto;border:2px solid transparent;background:none;padding:0;border-radius:10px}
.dstores button .lg{width:64px;height:32px;padding:3px 5px;display:flex;border:1px solid var(--line)}
.dstores button.on{border-color:#f2b705}
.dstores .dsall{border:1px solid var(--line);background:var(--card);color:var(--ink);padding:0 14px;height:36px;font-weight:700;font-size:14px}
.dstores .dsall.on{background:var(--g);border-color:var(--g);color:#fff}
.dcat{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--mut);margin:6px 0 4px}
.dcat select{flex:1;font-size:15px;padding:8px 10px;border-radius:10px;border:1px solid var(--line);background:var(--card);color:var(--ink)}
.xnote{font-size:13px;color:var(--mut);margin:8px 0}
.xempty{text-align:center;color:var(--mut);padding:26px 8px;font-size:15px;line-height:1.5}
.xempty b{color:var(--ink)}
.dgrp{margin:12px 0 4px}
.dgrp h3{display:flex;align-items:center;gap:8px;margin:0 0 6px;font-size:15.5px;color:var(--ink)}
.dgrp h3 .lg{width:70px;height:30px;padding:3px 5px;display:flex;border:1px solid var(--line)}
.dgrp h3 em{margin-left:auto;font-style:normal;font-size:12.5px;color:var(--mut);font-weight:600}
.drow{display:flex;align-items:center;gap:10px;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--card);margin:6px 0;cursor:pointer}
.drow.hasdrop{border-color:#f3b4c9;background:#fff5f8}
.xth{flex:0 0 52px;width:52px;height:52px;border-radius:8px;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden;border:1px solid var(--line)}
.xth img{max-width:100%;max-height:100%;object-fit:contain}
.xth.none{background:#f1f3f1}
.dn{flex:1;min-width:0}
.dn b{display:block;font-size:14px;font-weight:600;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.dn em{display:flex;align-items:center;gap:4px;flex-wrap:wrap;font-style:normal;font-size:12px;color:var(--mut);margin-top:2px}
.dn .deal{color:var(--sale);font-weight:600}
.dp{flex:0 0 auto;text-align:right;font-variant-numeric:tabular-nums;line-height:1.2}
.dp s{display:block;font-size:12px;color:var(--mut)}
.dp b{display:block;font-size:16px;color:var(--g)}
.dp .pct{display:inline-block;margin-top:2px;background:#fde8e6;color:var(--sale);font-weight:800;font-size:12px;border-radius:6px;padding:1px 5px}
.dmore{display:block;width:100%;padding:10px;border-radius:10px;border:1px dashed var(--line);background:none;color:var(--g);font-weight:700;font-size:14px}
.lg.xs{display:inline-flex;width:44px;height:18px;padding:1px 3px;border-radius:4px;border:1px solid var(--line)}
.wdrop{display:inline-block;margin-top:4px;background:#c2185b;color:#fff;font-size:11.5px;font-weight:800;border-radius:6px;padding:2px 7px}
.wdropt{color:#c2185b}
.wrm{flex:0 0 auto;width:34px;height:34px;border-radius:50%;border:1px solid #f3b4c9;background:#fff;color:#c2185b;font-size:16px}
.wgone{opacity:.7;cursor:default}
.wabtn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:13px;border:0;border-radius:12px;background:#1fa855;color:#fff;font-size:15.5px;font-weight:700;margin:4px 0 8px}
.wclear{display:block;margin:14px auto 0;border:0;background:none;color:var(--mut);text-decoration:underline;font-size:14px}
.inst{text-align:center;padding:8px 4px}
.inst img{border-radius:20px;box-shadow:0 6px 18px rgba(11,74,45,.25)}
.inst h3{margin:12px 0 4px;font-size:17px;color:var(--ink)}
.steps{text-align:left;font-size:15.5px;line-height:1.5;padding-left:22px;margin:16px 0}
.steps li{margin:8px 0}
.ios-share{display:inline-flex;vertical-align:-3px;color:#0a84ff}
.instbtn{max-width:320px;margin:16px auto}
.dwtheme{cursor:pointer;flex-wrap:wrap}
.dwtheme>span:nth-child(2){flex:1}
.dwauto{border:1px solid var(--line);background:var(--card);color:var(--g);border-radius:999px;padding:4px 10px;font-size:12.5px;font-weight:600}
.dws[hidden],.dwauto[hidden]{display:none}
.dws .lg.all{font-size:20px}

/* ---- dark mode ---- */
html.dark{--g:#4fc489;--g2:#3aa874;--bg:#0f1412;--card:#18201c;--ink:#e7ece9;--mut:#9aa7a0;--line:#2b3631;--sale:#ff7b6b;color-scheme:dark}
html.dark .top{background:#0b2a1c}
html.dark .menubtn,html.dark .toptabs button{border-color:rgba(255,255,255,.25);background:rgba(255,255,255,.08)}
html.dark #q,html.dark .chip,html.dark .summary,html.dark .more,html.dark .add,html.dark .drawer,html.dark .dws,html.dark .dwc,html.dark dialog,html.dark .scanbtn,html.dark .sortbar button{background:var(--card);color:var(--ink);border-color:var(--line)}
html.dark .chip.on,html.dark .add.in,html.dark .storepill button,html.dark .listbar button,html.dark .totop{background:#1f7a4d;border-color:#1f7a4d;color:#fff}
html.dark .dwsec{background:#141b18;border-color:var(--line)}
html.dark .row.best{background:#163325;border-color:#245c40}
html.dark .row.best .pr{color:#6fdca2}
html.dark .dws.on,html.dark .dwc.on{background:#163325;border-color:#2f8a5c}
html.dark .tag.upc{background:#173a29;color:#7fe0ab}html.dark .tag.name{background:#3a3014;color:#f0cf74}html.dark .tag.check{background:#3d1d1a;color:#ff9c8f}
html.dark .tag.one{background:#262f2b;color:var(--mut)}
html.dark .pic{background:var(--card)}
html.dark .pic img{border-radius:8px;background:#fff}
html.dark .pic.none{background:#141b18;border-color:var(--line)}
html.dark .storepill{background:#2b2513;border-color:#5c4c1d;color:var(--ink)}
html.dark .listbar{background:linear-gradient(transparent,var(--bg) 30%)}
html.dark .watch{background:rgba(24,32,28,.94);border-color:#4a2a37;color:#ff7aa8}
html.dark .watch.on{background:#c2185b;border-color:#c2185b;color:#fff}
html.dark .row .drop,html.dark .wdropt{color:#ff7aa8}
html.dark .dtabs{background:#101613}
html.dark .drow.hasdrop{background:#2a1820;border-color:#5a2a3d}
html.dark .dp b{color:#6fdca2}
html.dark .dp .pct{background:#3d1d1a;color:#ff9c8f}
html.dark .wrm{background:var(--card);border-color:#5a2a3d;color:#ff7aa8}
html.dark .xth.none{background:#141b18}
html.dark .about h3{color:#6fdca2}
html.dark .about a{color:#7cc4ff}
html.dark .pvinfo{background:#18201c;color:var(--ink)}
html.dark .pvcopytxt{background:#222c27;color:var(--ink);border-color:var(--line)}
html.dark .lg{box-shadow:0 0 0 1px rgba(255,255,255,.08)}
html.dark .dws .lg.all{background:#222c27!important;color:var(--ink)}
html.dark .bar span.f{background:#3aa874}
html.dark input[type=checkbox]{accent-color:#3aa874}
html.dark .dlghead button{color:var(--ink)}
html.dark .abback{color:#6fdca2}

/* shopping lists per store + history */
.row .slk{display:block;font-size:11px;font-weight:700;color:var(--g2);margin-top:1px}
.row.insl{border-color:#8fd0a9;background:#eef9f2}
.row.insl .slk{color:var(--g)}
.slk.demo{display:inline;color:var(--g2);font-weight:700}
.golists{display:block;width:100%;margin:4px 0 8px;padding:11px;border-radius:12px;border:1px solid var(--g2);background:#e9f6ee;color:var(--g);font-weight:700;font-size:15px}
.golists[hidden]{display:none}
.slnew{display:flex;gap:6px;flex-wrap:wrap;background:#f3f6f3;border:1px solid var(--line);border-radius:12px;padding:8px}
.slnew select,.slnew input{flex:1 1 40%;min-width:0;font-size:15px;padding:8px;border-radius:9px;border:1px solid var(--line);background:var(--card);color:var(--ink)}
.slnew button{flex:1 1 100%;padding:10px;border:0;border-radius:10px;background:var(--g);color:#fff;font-weight:700;font-size:15px}
.slcard{border:1px solid var(--line);border-radius:14px;background:var(--card);padding:10px;margin:12px 0}
.slcard h3{display:flex;align-items:center;gap:8px;margin:0 0 6px;cursor:pointer}
.slcard h3 .lg{width:70px;height:30px;padding:3px 5px;display:flex;border:1px solid var(--line);flex:0 0 70px}
.sln{flex:1;min-width:0}.sln b{display:block;font-size:15.5px;color:var(--ink)}.sln em,.slt em{display:block;font-style:normal;font-size:12px;color:var(--mut);font-weight:500}
.slt{text-align:right}.slt b{display:block;font-size:16px;color:var(--g);font-variant-numeric:tabular-nums}
.slrow{display:flex;align-items:center;gap:8px;padding:7px 2px;border-top:1px solid var(--line);font-size:14px}
.slrow.done .slnm{text-decoration:line-through;color:var(--mut)}
.slchk{flex:0 0 28px;width:28px;height:28px;border-radius:8px;border:2px solid var(--g2);background:var(--card);color:#fff;font-weight:900;font-size:15px;padding:0}
.slrow.done .slchk{background:var(--g2)}
.slnm{flex:1;min-width:0;line-height:1.3}.slnm em{font-style:normal;color:var(--sale);font-size:12px}
.slq{display:flex;align-items:center;gap:6px}.slq button{width:28px;height:28px;border-radius:50%;border:1px solid var(--line);background:var(--card);color:var(--ink);font-size:16px;padding:0}
.slp{flex:0 0 auto;min-width:58px;text-align:right;font-weight:700;font-variant-numeric:tabular-nums}
.hrow .slnm{padding-left:4px}
.slacts{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.slacts button{flex:1 1 auto;padding:9px 10px;border-radius:10px;border:1px solid var(--line);background:var(--card);color:var(--ink);font-size:14px;font-weight:600}
.slacts .wa{background:#1fa855;border-color:#1fa855;color:#fff}
.slacts .dn{background:var(--g);border-color:var(--g);color:#fff}
.slacts .link{flex:0 0 auto;border:0;background:none;color:var(--mut);text-decoration:underline;font-weight:500}
html.dark .row.insl{background:#15301f;border-color:#2f8a5c}
html.dark .golists{background:#163325;border-color:#2f8a5c;color:#7fe0ab}
html.dark .slnew{background:#141b18}
html.dark .slacts .dn,html.dark .slnew button{background:#1f7a4d;border-color:#1f7a4d}

.top h1.brand{font-size:19px}@media (max-width:400px){.top h1.brand{font-size:18px}}
.row .sl .slk{display:block}
.xdlg .abhead h2{color:var(--ink);font-size:18px}.xdlg .abhead button{color:var(--ink)}

/* dark mode: About / Terms / Weekly order / misc */
html.dark .abhead{background:#0b2a1c}
html.dark .xdlg .abhead{background:var(--card)}
html.dark .abstat div,html.dark .tot.best,html.dark .sortbar button.on{background:#163325}
html.dark .abstat b,html.dark .tot.best,html.dark .wsum .big b{color:#6fdca2}
html.dark .abupd,html.dark .abst,html.dark .abhow li,html.dark .qty button,html.dark .listacts .cp{background:var(--card);border-color:var(--line);color:var(--ink)}
html.dark .qty button,html.dark .listacts .cp{color:#6fdca2;border-color:#2f8a5c}
html.dark .wsum{background:#141b18}
html.dark .tagpill{background:#16223a;border-color:#2c4470}
html.dark .ot.op{background:#163325;color:#7fe0ab}
html.dark .ot.cl{background:#3d1d1a;color:#ff9c8f}
html.dark .bline,html.dark .terms p,html.dark .abnote{color:var(--ink)}
html.dark .tag.one{background:#262f2b;color:var(--mut)}
html.dark .sortbar button{color:var(--ink)}
html.dark .scanbox{background:#000}
html.dark .slchk{background:var(--card)}
html.dark .slrow.done .slchk{background:#3aa874}
/* add-to-list box */
.sladd{display:flex;gap:6px;margin-top:8px}
.sladd input{flex:1;min-width:0;font-size:15px;padding:9px 10px;border-radius:10px;border:1px solid var(--line);background:var(--card);color:var(--ink)}
.sladd button{flex:0 0 auto;padding:9px 14px;border:0;border-radius:10px;background:var(--g);color:#fff;font-weight:700}
html.dark .sladd button{background:#1f7a4d}
.slsug button{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px;margin-top:4px;border:1px solid var(--line);border-radius:10px;background:var(--card);color:var(--ink)}
.slsug .xth{flex-basis:40px;width:40px;height:40px}
.slsug .sfree{justify-content:center;font-weight:700;color:var(--g);border-style:dashed}
.slat{display:inline-flex;vertical-align:middle;margin-left:4px}
.lg.own{font-size:20px;background:#fff7e0!important;display:flex;align-items:center;justify-content:center}
html.dark .lg.own{background:#2b2513!important}
.slnew{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.slnew button{grid-column:1/-1}

.dwh a.dwweb{margin-left:8px}
