:root{
  --bg:#f3f4f6; --card:#fff; --ink:#111827; --muted:#6b7280; --line:#e5e7eb;
  --accent:#e8590c; --accent-ink:#fff; --navy:#14213d; --ok:#2f9e44; --warn:#f08c00; --bad:#e03131;
  --r:14px; --safe-b:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme:dark){
  :root{--bg:#0e1116; --card:#181c23; --ink:#f1f3f5; --muted:#9aa3b0; --line:#272d37; --navy:#0b1220}
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:var(--bg);color:var(--ink);
  font:15px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
#app{display:flex;flex-direction:column;height:100%;max-width:640px;margin:0 auto}
.top{display:flex;align-items:center;gap:8px;padding:10px 12px;background:var(--navy);color:#fff}
.top-title{flex:1;font-weight:700;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.icon-btn{background:transparent;border:0;color:inherit;font-size:28px;line-height:1;width:40px;height:40px;border-radius:10px;position:relative;display:grid;place-items:center;cursor:pointer}
.icon-btn[hidden]{display:none}
.badge{position:absolute;top:2px;right:0;background:var(--accent);color:#fff;font-size:11px;font-weight:700;min-width:18px;height:18px;border-radius:9px;display:grid;place-items:center;padding:0 5px}
.demo{background:#fff3bf;color:#5c4400;font-size:12px;text-align:center;padding:4px 8px}
main{flex:1;overflow-y:auto;padding:14px 14px 20px;-webkit-overflow-scrolling:touch}
.tabs{display:flex;background:var(--card);border-top:1px solid var(--line);padding-bottom:var(--safe-b)}
.tabs button{flex:1;background:none;border:0;padding:8px 2px 7px;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11px;cursor:pointer}
.tabs svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tabs button.on{color:var(--accent)}
h2{font-size:20px;margin:4px 0 12px}
h3{font-size:15px;margin:18px 0 8px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em;font-size:12px}
.card{background:var(--card);border-radius:var(--r);padding:14px;margin-bottom:10px;border:1px solid var(--line)}
.hero{background:linear-gradient(135deg,var(--navy),#22345e);color:#fff;border:0}
.hero p{margin:4px 0 0;opacity:.8}
.hero h2{margin:0;font-size:22px}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tile{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:14px;text-align:left;cursor:pointer;color:inherit;font:inherit;display:flex;flex-direction:column;gap:6px;min-height:92px}
.tile b{font-size:15px}.tile small{color:var(--muted)}
.tile .ic{width:34px;height:34px;border-radius:10px;background:rgba(232,89,12,.12);color:var(--accent);display:grid;place-items:center;font-size:18px}
.row{display:flex;align-items:center;gap:10px}
.row.sb{justify-content:space-between}
.muted{color:var(--muted)}.small{font-size:13px}
.btn{background:var(--accent);color:var(--accent-ink);border:0;border-radius:12px;padding:13px 16px;font:inherit;font-weight:700;cursor:pointer;width:100%}
.btn.sec{background:transparent;color:var(--ink);border:1px solid var(--line)}
.btn.sm{padding:8px 12px;width:auto;font-size:14px;border-radius:10px}
.btn:disabled{opacity:.5}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:6px;margin:0 -14px 8px;padding-left:14px;padding-right:14px;scrollbar-width:none}
.chip{white-space:nowrap;border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:20px;padding:7px 13px;font:inherit;font-size:14px;cursor:pointer}
.chip.on{background:var(--navy);color:#fff;border-color:var(--navy)}
input,select,textarea{width:100%;font:inherit;color:var(--ink);background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px;margin-top:4px}
textarea{min-height:96px;resize:vertical}
label{display:block;font-size:13px;color:var(--muted);margin-top:12px}
.item{display:flex;gap:12px;align-items:center}
.thumb{width:64px;height:64px;overflow:hidden;border-radius:12px;background:rgba(20,33,61,.08);color:var(--navy);display:grid;place-items:center;flex:none;font-weight:800;font-size:12px}
@media (prefers-color-scheme:dark){.thumb{background:rgba(255,255,255,.08);color:#cbd5e1}}
.item .grow{flex:1;min-width:0}.item .name{font-weight:600}
.qty{display:flex;align-items:center;gap:6px}
.qty button{width:32px;height:32px;border-radius:10px;border:1px solid var(--line);background:var(--card);color:var(--ink);font-size:18px;cursor:pointer}
.qty span{min-width:22px;text-align:center;font-weight:700}
.status{display:inline-block;border-radius:8px;padding:2px 8px;font-size:12px;font-weight:700}
.st-new{background:#e7f5ff;color:#1864ab}.st-work{background:#fff3bf;color:#8a5a00}.st-done{background:#d3f9d8;color:#1e6b2a}.st-wait{background:#ffe8cc;color:#a14a00}
.msgs{display:flex;flex-direction:column;gap:8px;margin:10px 0}
.msg{max-width:84%;padding:9px 12px;border-radius:14px;background:var(--card);border:1px solid var(--line);white-space:pre-wrap;word-break:break-word}
.msg.me{align-self:flex-end;background:var(--accent);color:#fff;border-color:var(--accent)}
.msg small{display:block;opacity:.7;font-size:11px;margin-top:3px}
.composer{display:flex;gap:8px;position:sticky;bottom:-20px;background:var(--bg);padding:8px 0 4px}
.composer input{margin:0}.composer .btn{width:auto;padding:0 18px}
details{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:12px 14px;margin-bottom:8px}
summary{font-weight:600;cursor:pointer}
details p{margin:8px 0 0;color:var(--muted)}
.empty{text-align:center;color:var(--muted);padding:28px 10px}
.sheet{position:fixed;inset:0;z-index:20;display:flex;align-items:flex-end;justify-content:center}
.sheet[hidden]{display:none}
.sheet-bg{position:absolute;inset:0;background:rgba(0,0,0,.5)}
.sheet-body{position:relative;background:var(--bg);width:100%;max-width:640px;max-height:88%;overflow-y:auto;border-radius:20px 20px 0 0;padding:16px 14px calc(16px + var(--safe-b))}
.toast{position:fixed;left:50%;bottom:84px;transform:translateX(-50%);background:#111;color:#fff;padding:10px 16px;border-radius:12px;z-index:30;max-width:90%;font-size:14px}
.toast[hidden]{display:none}
.news{border-left:3px solid var(--accent);padding-left:10px;margin-bottom:10px}
.news b{display:block}
.badge[hidden]{display:none}

.thumb img{width:100%;height:100%;object-fit:contain;background:#fff;border-radius:12px;display:block}
.thumb:has(img){background:#fff;border:1px solid var(--line)}
