:root{
  --green:#177a3a; --green-dark:#0f5c2b; --green-soft:#e7f4ec;
  --ink:#1c2b21; --muted:#5d6f63; --line:#dde7e0;
  --card:#ffffff; --bg:#f4f7f5; --amber:#b7791f; --amber-soft:#fdf3e0;
  --red:#b3261e; --blue:#1a5fb4;
  --radius:14px; --tap:48px;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{margin:0;padding:0;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg); color:var(--ink); font-size:16px; line-height:1.45;
  padding-bottom:calc(76px + env(safe-area-inset-bottom));
}
#hdr{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 14px; padding-top:calc(10px + env(safe-area-inset-top));
  background:var(--green); color:#fff;
}
.hdr-title{font-size:20px; font-weight:700;}
.hdr-right{display:flex; gap:8px; align-items:center;}
.loc-pill{
  border:1px solid rgba(255,255,255,.5); background:rgba(255,255,255,.15); color:#fff;
  border-radius:999px; padding:8px 12px; font-size:14px; min-height:var(--tap);
}
.icon-btn{
  border:1px solid rgba(255,255,255,.5); background:rgba(255,255,255,.15); color:#fff;
  border-radius:12px; font-size:20px; min-width:var(--tap); min-height:var(--tap);
}
.pip-btn{
  border:1px solid rgba(255,255,255,.7); background:#fff; color:var(--ink);
  border-radius:999px; padding:8px 12px; font-size:14px; font-weight:600; min-height:var(--tap);
}
#view{padding:14px 14px 20px; max-width:720px; margin:0 auto;}
#tabs{
  position:fixed; left:0; right:0; bottom:0; z-index:20;
  display:flex; background:#fff; border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom);
}
.tab{
  flex:1; border:0; background:none; color:var(--muted);
  display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:8px 2px 6px; min-height:64px; font-size:12px;
}
.tab .t-ico{font-size:22px;}
.tab.active{color:var(--green); font-weight:700;}
.card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:14px; margin-bottom:12px; box-shadow:0 1px 2px rgba(0,0,0,.04);
}
.card h2{margin:0 0 8px; font-size:18px;}
.card h3{margin:12px 0 6px; font-size:16px;}
.muted{color:var(--muted);} .small{font-size:13px;}
.honest{
  background:var(--amber-soft); border:1px solid #ecd9ae; border-radius:var(--radius);
  padding:10px 12px; margin-bottom:12px; font-size:14px; color:#6b4d12;
}
.win{background:var(--green-soft); border:1px solid #bfe0cc; border-radius:var(--radius); padding:12px; margin:10px 0;}
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-height:var(--tap); padding:10px 16px; border-radius:12px; border:1px solid var(--line);
  background:#fff; color:var(--ink); font-size:16px; font-weight:600; cursor:pointer;
}
.btn:active{transform:scale(.98);}
.btn-primary{background:var(--green); border-color:var(--green-dark); color:#fff;}
.btn-danger{background:#fff; border-color:var(--red); color:var(--red);}
.btn-big{width:100%; font-size:17px;}
.btn-row{display:flex; gap:8px; flex-wrap:wrap; margin:8px 0;}
.btn-row .btn{flex:1; min-width:140px;}
input[type=text],input[type=number],input[type=password],input[type=url],select,textarea{
  width:100%; min-height:var(--tap); font-size:16px; padding:10px 12px;
  border:1px solid var(--line); border-radius:12px; background:#fff; color:var(--ink); margin:4px 0;
}
textarea{min-height:96px; resize:vertical;}
label.f{display:block; font-size:14px; font-weight:600; margin:10px 0 2px;}
.row2{display:flex; gap:8px;} .row2>*{flex:1;}
table.cmp{width:100%; border-collapse:collapse; font-size:14px; margin-top:8px;}
table.cmp th,table.cmp td{border-bottom:1px solid var(--line); padding:10px 6px; text-align:left; vertical-align:top;}
table.cmp th{font-size:12px; text-transform:uppercase; color:var(--muted);}
tr.best td{background:var(--green-soft); font-weight:700;}
.badge{display:inline-block; font-size:12px; padding:2px 8px; border-radius:999px; background:#eef2ef; color:var(--muted); margin-left:6px;}
.badge.alt{background:#fff3d6; color:#8a5a00;}
.store-row{border:1px solid var(--line); border-radius:12px; padding:10px; margin:8px 0;}
.store-row .s-name{font-weight:700;}
.store-row .s-addr{font-size:13px; color:var(--muted);}
.check{display:flex; align-items:center; gap:10px; min-height:var(--tap); font-size:16px;}
.check input{width:22px; height:22px;}
.prod{display:flex; gap:10px; align-items:center; padding:10px 0; border-bottom:1px solid var(--line);}
.prod img{width:56px; height:56px; object-fit:contain; border-radius:8px; background:#f6f8f7;}
.prod .p-name{font-weight:700;} .prod .p-brand{font-size:13px; color:var(--muted);}
#toast{
  position:fixed; left:50%; transform:translateX(-50%);
  bottom:calc(92px + env(safe-area-inset-bottom)); z-index:50;
  background:#1c2b21; color:#fff; padding:12px 18px; border-radius:999px;
  font-size:15px; opacity:0; pointer-events:none; transition:opacity .25s; max-width:90vw; text-align:center;
}
#toast.show{opacity:1;}
.sheet-wrap{position:fixed; inset:0; z-index:40; background:rgba(0,0,0,.45); display:flex; align-items:flex-end; justify-content:center;}
.sheet-wrap.hidden{display:none;}
.sheet{background:#fff; width:100%; max-width:720px; max-height:88vh; overflow:auto; border-radius:20px 20px 0 0; padding:18px 16px calc(20px + env(safe-area-inset-bottom));}
#scanOverlay{position:fixed; inset:0; z-index:60; background:#000; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; padding:20px;}
#scanOverlay.hidden{display:none;}
#scanVideo{width:100%; max-width:480px; border-radius:12px; background:#111;}
.scan-hint{color:#fff; font-size:16px;}
.chat{display:flex; flex-direction:column; gap:8px; margin:10px 0;}
.msg{padding:10px 12px; border-radius:14px; max-width:92%; font-size:15px; white-space:pre-wrap;}
.msg.user{background:var(--green); color:#fff; align-self:flex-end;}
.msg.bot{background:#eef2ef; align-self:flex-start;}
.msg .who{font-size:11px; color:var(--muted); margin-bottom:4px;}
.chat-input{display:flex; gap:8px; position:sticky; bottom:0; background:var(--bg); padding:8px 0;}
.bot-pick{display:flex; gap:8px; margin-bottom:10px;}
.bot-pick .btn{flex:1;}
.bot-pick .btn.sel{background:var(--green-soft); border-color:var(--green); color:var(--green-dark);}
.hist-row{display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid var(--line); font-size:14px;}
.kv{display:flex; justify-content:space-between; padding:6px 0; font-size:15px;}
.kv b{font-size:16px;}
.hr{border:0; border-top:1px solid var(--line); margin:12px 0;}
.center{text-align:center;} .mt{margin-top:12px;}
.linklike{background:none;border:0;color:var(--blue);font-size:15px;padding:8px;min-height:var(--tap);text-decoration:underline;cursor:pointer;}
