:root {
  --bg: #ffffff; --fg: #1b1b1b; --grey: #6b6b6b; --line: #e3e3e3;
  --green: #2e7d32; --red: #c62828; --orange: #e65100; --blue: #1565c0;
  --card: #f6f6f6;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: -apple-system, "SF Pro Text", "Segoe UI", Arial, sans-serif; font-size: 17px;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
#app { max-width: 640px; margin: 0 auto; padding: 12px 14px 24px; }
button { font: inherit; border: 0; border-radius: 12px; cursor: pointer; }
.big { display: block; width: 100%; padding: 18px; font-size: 21px; font-weight: 700; color: #fff; background: var(--blue); margin: 10px 0; }
.big.green { background: var(--green); } .big.grey { background: #8a8a8a; } .big.red { background: var(--red); }
.big:disabled { opacity: .4; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.top h1 { flex: 1; font-size: 21px; margin: 0; }
.back { background: none; color: var(--blue); font-size: 18px; padding: 8px 4px; }
.pill { background: var(--green); color: #fff; padding: 10px 14px; font-weight: 700; }
.logo { display: block; margin: 18px auto 6px; max-height: 150px; max-width: 80%; }
.center { text-align: center; }
.muted { color: var(--grey); font-size: 14px; }
.warn { color: var(--orange); font-weight: 700; }
.err { color: var(--red); font-weight: 700; }
.ok { color: var(--green); font-weight: 700; }
input[type=text], input[type=search] {
  font: inherit; font-size: 19px; width: 100%; padding: 12px; border: 1px solid #bbb; border-radius: 10px; background: #fff; color: var(--fg);
}
.ltr { direction: ltr; text-align: left; }
.list { margin: 6px 0; }
.item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.thumb { width: 60px; height: 60px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; flex: none; }
.thumb.empty { display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 11px; }
.title { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; color: var(--green); }
.price.sale { color: var(--red); }
.strike { text-decoration: line-through; color: var(--grey); font-weight: 400; font-size: .85em; margin-inline-start: 6px; }
.prod img.main { display: block; width: 100%; max-height: 320px; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.prod h2 { font-size: 22px; margin: 10px 0 4px; }
.prod .bigprice { font-size: 30px; }
.stock { font-size: 20px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { background: #fff; border: 1px solid var(--blue); color: var(--blue); padding: 6px 10px; border-radius: 16px; font-size: 14px; }
.chip.on { background: var(--blue); color: #fff; }
.note { padding: 10px; border-radius: 10px; background: #fff3e0; margin: 8px 0; }
.hidden-tag { background: #eee; color: var(--grey); border-radius: 6px; padding: 1px 6px; font-size: 12px; margin-inline-start: 4px; }
#reader { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
#reader video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* המסגרת = האזור שנקרא: 90% רוחב, 40% גובה, במרכז */
#reader .frame { position: absolute; left: 5%; right: 5%; top: 30%; bottom: 30%; border: 3px solid #4caf50; border-radius: 10px;
  box-shadow: 0 0 0 999px rgba(0,0,0,.35); pointer-events: none; }
#reader .torch { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.85); font-size: 22px; padding: 6px 10px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { background: #fff; width: 100%; max-width: 640px; max-height: 85vh; border-radius: 16px 16px 0 0; padding: 14px; display: flex; flex-direction: column; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.sheet .scroll { overflow-y: auto; flex: 1; margin: 8px 0; }
.check { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.check input { width: 22px; height: 22px; }
.sheet .row button { flex: 1; padding: 12px; font-weight: 700; }
.btn-blue { background: var(--blue); color: #fff; } .btn-light { background: #eee; color: var(--fg); }
