:root { --bg:#fafaf7; --card:#fff; --ink:#1b1b1b; --muted:#666; --line:#e4e2dc; --accent:#1f6f4a; --accent-ink:#fff;
        --warn:#b45309; --bad:#b91c1c; --good:#15803d; --chip:#eef2ee; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#141414; --card:#1f1f1f; --ink:#ececec; --muted:#a3a3a3; --line:#333; --accent:#3ea56f; --accent-ink:#0b1f14; --chip:#263229; }
}
* { box-sizing:border-box; }
body { margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; background:var(--bg); color:var(--ink);
       font-size:16px; line-height:1.35; padding-bottom:70px; }
a { color:var(--accent); text-decoration:none; }
header.top { position:sticky; top:0; background:var(--bg); padding:10px 14px 6px; border-bottom:1px solid var(--line); z-index:5;
             display:flex; align-items:center; gap:10px; }
header.top h1 { font-size:18px; margin:0; flex:1; }
header.top form { margin:0; }
header.top input[type=date] { font-size:14px; padding:4px 6px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--ink); }
main { padding:12px 14px; max-width:720px; margin:0 auto; }
h2 { font-size:15px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); margin:18px 0 8px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px; margin-bottom:10px; }
.card.link { display:block; color:inherit; }
.row { display:flex; align-items:center; gap:10px; }
.row .grow { flex:1; min-width:0; }
.title { font-weight:600; }
.sub { color:var(--muted); font-size:14px; }
.price { font-weight:700; font-size:18px; white-space:nowrap; }
.unit { color:var(--muted); font-size:13px; }
.chip { display:inline-block; font-size:12px; padding:2px 8px; border-radius:999px; background:var(--chip); color:var(--ink); margin:2px 4px 0 0; }
.chip.good { background:#dcfce7; color:#14532d; } .chip.bad { background:#fee2e2; color:#7f1d1d; } .chip.warn { background:#fef3c7; color:#78350f; }
.chip.muted { color:var(--muted); }
@media (prefers-color-scheme: dark) { .chip.good{background:#14532d;color:#dcfce7} .chip.bad{background:#7f1d1d;color:#fee2e2} .chip.warn{background:#78350f;color:#fef3c7} }
.badge { font-size:12px; font-weight:600; padding:2px 6px; border-radius:6px; background:var(--chip); }
button, .btn { font:inherit; font-size:15px; padding:10px 14px; border-radius:10px; border:1px solid var(--line); background:var(--card); color:var(--ink); cursor:pointer; min-height:44px; }
button.primary, .btn.primary { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); font-weight:600; }
button.danger { background:var(--bad); color:#fff; border-color:var(--bad); }
button.small { min-height:36px; padding:6px 10px; font-size:14px; }
input[type=number], input[type=text], select, textarea { font:inherit; padding:9px 10px; border:1px solid var(--line); border-radius:10px; background:var(--card); color:var(--ink); min-height:44px; }
input[type=number] { width:80px; text-align:center; }
form.inline { display:inline-flex; gap:6px; align-items:center; margin:0; }
.stepper { display:inline-flex; align-items:center; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.stepper button { border:0; border-radius:0; min-width:44px; }
.stepper input { border:0; border-radius:0; width:56px; min-height:44px; }
nav.bottom { position:fixed; bottom:0; left:0; right:0; background:var(--card); border-top:1px solid var(--line); display:flex; z-index:5; }
nav.bottom a { flex:1; text-align:center; padding:10px 4px 12px; font-size:12px; color:var(--muted); }
nav.bottom a.active { color:var(--accent); font-weight:600; }
nav.bottom a span { display:block; font-size:20px; }
.total { font-size:20px; font-weight:700; }
.muted { color:var(--muted); }
.small { font-size:13px; }
.done { opacity:.55; text-decoration:line-through; }
details summary { cursor:pointer; color:var(--accent); padding:6px 0; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.err { color:var(--bad); font-weight:600; }
.search { width:100%; margin-bottom:8px; }
label.opt { display:flex; gap:8px; align-items:center; padding:6px 0; }
.hdr-note { font-size:13px; color:var(--muted); margin:0 0 10px; }
select, input[type=text] { max-width:100%; min-width:0; }
label.opt select, label.opt input[type=text] { flex:1; }
button.primary { white-space:nowrap; }
.card form.row > .grow { min-width:0; }
a.chip { text-decoration:underline; text-decoration-style:dotted; }
button.linkbtn { background:none; border:0; padding:0; min-height:0; color:var(--accent); font:inherit; font-size:14px; text-decoration:underline; cursor:pointer; }
