:root { --bg:#0f1115; --card:#1a1e27; --line:#262a33; --muted:#8b93a7;
  --text:#e8eaed; --blue:#2563eb; --green:#4ade80; --p:#f87171; --c:#fbbf24; --f:#60a5fa; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text);
  font-family:system-ui,-apple-system,sans-serif; -webkit-tap-highlight-color:transparent; }
.view { padding:20px; }
.hidden { display:none !important; }
input { width:100%; padding:14px; border-radius:10px; border:1px solid var(--line);
  background:var(--card); color:var(--text); font-size:16px; margin:8px 0; }
button { font-size:16px; cursor:pointer; }
#login-btn { width:100%; padding:14px; border:none; border-radius:10px;
  background:var(--blue); color:#fff; }
.err { color:var(--p); font-size:13px; }
#macro-bar { display:flex; justify-content:space-around; padding:16px;
  position:sticky; top:0; background:var(--bg); border-bottom:1px solid var(--line); }
.macro { text-align:center; }
.macro .v { font-size:20px; font-weight:700; }
.macro .l { font-size:11px; color:var(--muted); }
.tab { padding:16px 16px 120px; }
.cal-total { text-align:center; margin:8px 0; font-size:30px; font-weight:700; }
.cal-total span { font-size:14px; color:var(--muted); }
.bar { height:6px; background:var(--line); border-radius:3px; margin:0 14px 18px; }
.bar > div { height:100%; background:var(--green); border-radius:3px; }
.meal-label { font-size:11px; color:var(--muted); margin:14px 0 4px; text-transform:uppercase; }
.entry { display:flex; justify-content:space-between; padding:10px 0;
  border-bottom:1px solid var(--card); }
.entry .cal { color:var(--muted); }
#fab { position:fixed; right:16px; bottom:78px; display:flex; gap:12px; }
#fab button { width:60px; height:60px; border-radius:50%; border:none; color:#fff;
  background:radial-gradient(circle,#3b82f6,#2563eb); font-size:24px;
  box-shadow:0 0 24px rgba(59,130,246,.5); }
#scan-btn, #type-btn { background:#374151; box-shadow:none; }
#tabbar { position:fixed; bottom:0; left:0; right:0; display:flex;
  background:var(--bg); border-top:1px solid var(--line); }
#tabbar button { flex:1; padding:16px; background:none; border:none; color:var(--muted); }
#tabbar button.active { color:var(--text); }
.sheet { position:fixed; inset:0; background:rgba(0,0,0,.6); display:flex;
  align-items:flex-end; z-index:10; }
.sheet-inner { background:var(--bg); width:100%; border-radius:18px 18px 0 0; padding:18px; }
.confirm-item { background:var(--card); border-radius:12px; padding:12px; margin-bottom:10px; }
.confirm-item input { width:auto; padding:6px; }
.row { display:flex; gap:10px; margin-top:8px; }
.row .primary { flex:2; background:var(--blue); color:#fff; border:none;
  border-radius:10px; padding:12px; }
.row .ghost { flex:1; background:none; border:1px solid var(--line);
  color:var(--muted); border-radius:10px; padding:12px; }
#attribution { position:fixed; bottom:56px; width:100%; text-align:center;
  font-size:10px; color:var(--muted); pointer-events:none; }
#scanner { position:fixed; inset:0; background:#000; z-index:20;
  display:flex; flex-direction:column; }
#cam { flex:1; object-fit:cover; width:100%; }
