:root { --bg:#101418; --card:#1a2027; --line:#2a323c; --text:#e8edf2; --dim:#8b97a5; --acc:#4ade80; --bad:#f87171; --warn:#fbbf24; }
* { box-sizing:border-box; }
html, body { margin:0; background:var(--bg); color:var(--text); font:16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width:560px; margin:0 auto; padding:16px 14px calc(84px + env(safe-area-inset-bottom)); }
h1 { font-size:22px; margin:6px 0 14px; }
h2 { font-size:15px; margin:0 0 10px; color:var(--dim); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px; margin-bottom:12px; }
.row { display:flex; gap:10px; align-items:center; }
.row > * { flex:1; }
.big { font-size:34px; font-weight:700; line-height:1.1; }
.dim { color:var(--dim); font-size:14px; }
.good { color:var(--acc); } .bad { color:var(--bad); } .warn { color:var(--warn); }
.grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.stat b { display:block; font-size:20px; }
.bar { height:10px; background:var(--line); border-radius:6px; overflow:hidden; margin:10px 0 6px; }
.bar i { display:block; height:100%; background:var(--acc); }
.bar i.over { background:var(--bad); }
button, .btn { background:var(--acc); color:#06210f; border:0; border-radius:10px; padding:12px 14px; font:inherit; font-weight:600; cursor:pointer; }
button.ghost { background:transparent; color:var(--text); border:1px solid var(--line); }
button.small { padding:6px 10px; font-size:14px; flex:0 0 auto; }
button:disabled { opacity:.5; }
input, select, textarea { width:100%; background:var(--bg); color:var(--text); border:1px solid var(--line); border-radius:10px; padding:11px; font:inherit; }
textarea { min-height:70px; resize:vertical; }
label { display:block; margin:10px 0 4px; font-size:14px; color:var(--dim); }
table { width:100%; border-collapse:collapse; font-size:15px; }
td, th { padding:6px 4px; text-align:right; border-bottom:1px solid var(--line); }
td:first-child, th:first-child { text-align:left; }
th { color:var(--dim); font-weight:500; font-size:13px; }
.item { padding:10px 0; border-bottom:1px solid var(--line); }
.item:last-child { border-bottom:0; }
.item img { width:56px; height:56px; object-fit:cover; border-radius:8px; flex:0 0 56px; }
.task { display:flex; gap:12px; align-items:flex-start; }
.task input { width:24px; height:24px; flex:0 0 24px; margin-top:2px; accent-color:var(--acc); }
.task.done .t { text-decoration:line-through; color:var(--dim); }
nav { position:fixed; left:0; right:0; bottom:0; display:flex; background:var(--card); border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom); }
nav button { flex:1; background:none; color:var(--dim); border-radius:0; padding:14px 0; font-size:11.5px; font-weight:500; letter-spacing:-.01em; }
nav button.on { color:var(--acc); }
#toast { position:fixed; left:14px; right:14px; bottom:calc(76px + env(safe-area-inset-bottom)); background:#33161a; color:#fecaca; border:1px solid var(--bad); border-radius:10px; padding:12px; z-index:9; cursor:pointer; }
svg.chart { width:100%; height:160px; display:block; }
[hidden] { display:none !important; }
details { border-bottom:1px solid var(--line); padding:10px 0; }
details:last-of-type { border-bottom:0; }
summary { cursor:pointer; font-weight:600; }
summary span { font-weight:400; }
.meal { padding:10px 0 4px; }
.meal .row { align-items:flex-start; }
.check { display:flex; gap:10px; align-items:center; padding:7px 0; margin:0; font-size:16px; color:var(--text); }
.check input { width:20px; height:20px; flex:0 0 20px; accent-color:var(--acc); }
.check.on span { text-decoration:line-through; color:var(--dim); }
.pair { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.pair img, .thumbs img { width:100%; border-radius:10px; display:block; }
.pair figure, .thumbs figure { margin:0; }
figcaption { font-size:13px; color:var(--dim); padding:4px 0; display:flex; justify-content:space-between; align-items:center; }
.thumbs { display:grid; grid-template-columns:repeat(2, 1fr); gap:8px; margin-top:10px; }
.seg { display:flex; gap:6px; margin-bottom:10px; }
.seg button { flex:1; padding:8px 4px; font-size:14px; }
input[type=range] { accent-color:var(--acc); border:0; background:none; height:32px; }
.msg { padding:10px 12px; border-radius:12px; margin:8px 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.msg.user { background:#1f3a2a; margin-left:36px; }
.msg.assistant { background:var(--bg); border:1px solid var(--line); margin-right:12px; }
.msg small { display:block; color:var(--dim); font-size:12px; margin-top:4px; }
.pre { white-space:pre-wrap; }
