:root {
  --bg: #f6f5f0; --card: #ffffff; --text: #1d2a1f; --muted: #66706a; --line: #dfe2dc;
  --accent: #2f6b3a; --accent-text: #ffffff; --danger: #b3261e; --badge: #e7f0e4;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151a16; --card: #1f2620; --text: #e8ece6; --muted: #9aa59c; --line: #333d35;
          --accent: #5fa86c; --accent-text: #0d140e; --danger: #f2827b; --badge: #2a3a2c; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
section { max-width: 760px; margin: 0 auto; padding: 12px 16px 96px; }
h1 { font-size: 1.4em; margin: 24px 0 16px; }
h2 { font-size: 1.2em; margin: 0; }
h3 { margin: 8px 0 4px; }
label { display: block; margin: 12px 0; color: var(--muted); font-size: .9em; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 12px; font: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
button { font: inherit; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--danger); }
button.big { width: 100%; padding: 16px; font-size: 1.1em; }
button.icon { padding: 8px 12px; font-size: 1.2em; }
.error { color: var(--danger); min-height: 1.2em; }
.hint, .note { color: var(--muted); font-size: .9em; }
.note { background: var(--badge); padding: 10px 12px; border-radius: 10px; color: var(--text); }
header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0 8px; }
header .who { display: flex; flex-direction: column; }
header h2 { flex: 1; margin-left: 4px; }
header .who span { color: var(--muted); font-size: .85em; }
#menu { display: flex; gap: 8px; margin-bottom: 8px; }
.tools { display: grid; gap: 8px; margin: 8px 0 12px; }
.group h3 { font-size: .95em; color: var(--muted); margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.product { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; margin: 0 0 6px; padding: 10px 12px; }
.product img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; }
.product .name { flex: 1; }
.product .price { color: var(--muted); white-space: nowrap; }
.product .qty { background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 2px 10px; font-weight: 600; }
#cart-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line); }
#cart-bar button { display: block; width: 100%; max-width: 728px; margin: 0 auto; }
.line { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.line input { margin: 0; padding: 8px; text-align: right; }
.line .sum { color: var(--muted); font-size: .85em; }
.line button { padding: 8px 10px; }
#totals { margin: 12px 0; text-align: right; }
#totals b { font-size: 1.15em; }
#send { margin-top: 8px; }
#cancel-order { width: 100%; margin-top: 12px; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.overlay[hidden] { display: none; }
.card { background: var(--card); width: 100%; max-width: 560px; border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.card img { width: 100%; max-height: 38vh; object-fit: contain; border-radius: 10px; background: var(--bg); }
.card .row { display: flex; gap: 8px; }
.card .row button { flex: 1; }
.overlay.dark { background: #000; flex-direction: column; align-items: stretch; justify-content: flex-start; z-index: 5; }
#video { width: 100%; height: 70vh; object-fit: cover; }
.aim { position: absolute; left: 12%; right: 12%; top: 26vh; height: 18vh; border: 3px solid rgba(255,255,255,.8); border-radius: 12px; pointer-events: none; }
#scan-msg { color: #fff; text-align: center; margin: 12px 16px; min-height: 2.6em; }
#scan-close { margin: 0 16px; width: auto; }
#toast { position: fixed; left: 16px; right: 16px; bottom: 84px; max-width: 560px; margin: 0 auto; background: var(--text); color: var(--bg);
  padding: 12px 16px; border-radius: 10px; z-index: 20; text-align: center; }
