:root { --bg:#f4f5f7; --card:#fff; --line:#e3e6ea; --text:#1b1d21; --muted:#6b7280; --g:#1E8A44; --red:#c62828; --link:#2563eb; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg:#111317; --card:#1c1f24; --line:#2c3036; --text:#eceef1; --muted:#9aa1ab; --link:#7aa7ff; }
}
:root[data-theme="dark"] { --bg:#111317; --card:#1c1f24; --line:#2c3036; --text:#eceef1; --muted:#9aa1ab; --link:#7aa7ff; }
.themes { display:flex; gap:6px; margin:6px 0 4px; }
.themes button { flex:1; border:1px solid var(--line); background:var(--bg); border-radius:10px; padding:10px 4px; font-size:14px; }
.themes button.on { border-color:var(--g); color:var(--g); font-weight:700; }
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { margin:0; background:var(--bg); color:var(--text); font-family:"Segoe UI", Roboto, system-ui, sans-serif; }
.hidden { display:none !important; }
button { font:inherit; color:inherit; cursor:pointer; }
.bar { position:sticky; top:0; z-index:4; background:var(--card); border-bottom:1px solid var(--line);
  padding:calc(12px + env(safe-area-inset-top)) 14px 10px; }
.titlerow { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
h1 { margin:0; font-size:22px; }
.seg { display:flex; background:var(--bg); border-radius:12px; padding:3px; }
.seg button { flex:1; border:0; background:none; padding:9px 2px; border-radius:10px; font-weight:600; font-size:14px; color:var(--muted); }
.seg button.on { background:var(--card); color:var(--text); box-shadow:0 1px 3px rgba(0,0,0,.14); }
.wrap { max-width:640px; margin:0 auto; padding:12px 12px 80px; }
.addrow { position:relative; }
.add { width:100%; border:1px solid var(--line); background:var(--card); color:var(--text); border-radius:14px;
  padding:13px 14px; font-size:16px; outline:none; }
.add:focus { border-color:var(--g); }
.addrow .add { padding-right:58px; }
.addbtn { position:absolute; right:6px; top:6px; width:40px; height:40px; border:0; border-radius:10px; background:var(--g);
  color:#fff; font-size:24px; line-height:1; }
.sugg .addnew { color:var(--g); font-weight:600; }
.sugg { position:absolute; left:0; right:0; top:52px; background:var(--card); border:1px solid var(--line); border-radius:14px;
  box-shadow:0 8px 24px rgba(0,0,0,.14); overflow:hidden; z-index:5; }
.sugg button { display:flex; width:100%; gap:10px; align-items:center; border:0; border-top:1px solid var(--line);
  background:none; padding:12px 14px; text-align:left; font-size:15px; }
.sugg button:first-child { border-top:0; }
.sugg small { margin-left:auto; color:var(--muted); font-size:12px; }
.list { background:var(--card); border:1px solid var(--line); border-radius:16px; margin-top:12px; overflow:hidden; }
.list:empty { display:none; }
.item { display:flex; align-items:center; gap:12px; padding:9px 12px; border-top:1px solid var(--line); min-height:58px; }
.item:first-child { border-top:0; }
.thumb { width:42px; height:42px; border-radius:10px; flex:none; background:var(--bg); display:grid; place-items:center;
  font-size:22px; overflow:hidden; }
.thumb img { width:100%; height:100%; object-fit:cover; }
.txt { flex:1; min-width:0; cursor:pointer; }
.txt b { font-weight:500; font-size:16px; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.txt small { color:var(--muted); font-size:12px; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.box { width:30px; height:30px; border-radius:9px; border:2px solid var(--muted); flex:none; background:none; padding:0;
  display:grid; place-items:center; }
.item.done .box { background:var(--g); border-color:var(--g); }
.item.done .box::after { content:""; width:7px; height:13px; border:solid #fff; border-width:0 2.5px 2.5px 0;
  transform:rotate(45deg) translate(-1px,-1px); }
.item.done b { color:var(--muted); text-decoration:line-through; }
.donehead { display:flex; justify-content:space-between; margin-top:16px; }
.ghost { border:0; background:none; padding:6px; color:var(--muted); font-size:14px; }
#menu { font-size:24px; }
.danger { color:var(--red); }
.empty { text-align:center; color:var(--muted); margin-top:30px; }
.sheet { position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:10; display:flex; align-items:flex-end; justify-content:center; }
.sheetin { width:100%; max-width:640px; max-height:92vh; overflow:auto; background:var(--card); border-radius:22px 22px 0 0;
  padding:14px 16px calc(20px + env(safe-area-inset-bottom)); }
.grab { width:40px; height:4px; background:var(--line); border-radius:2px; margin:0 auto 12px; }
.photo { height:min(52vh, 360px); border-radius:14px; background:var(--bg); display:flex; align-items:center; justify-content:center; color:var(--muted);
  overflow:hidden; cursor:pointer; }
.photo img { max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; display:block; }
.photo.has { background:#fff; }
.photobtns { display:flex; gap:8px; margin:8px 0 6px; }
label { display:block; font-size:12px; color:var(--muted); margin-top:10px; }
label input, label select { display:block; width:100%; margin-top:4px; border:1px solid var(--line); background:var(--bg);
  color:var(--text); border-radius:12px; padding:11px 12px; font-size:16px; outline:none; }
.openlink { display:inline-block; margin-top:6px; color:var(--link); font-size:14px; }
.by { color:var(--muted); font-size:12px; }
.btns { display:flex; gap:10px; margin-top:14px; }
.btn { flex:1; border:0; padding:12px; border-radius:12px; font-weight:600; background:var(--bg); }
.btn.primary { background:var(--g); color:#fff; }
.btn.wide { width:100%; margin-top:10px; }
.screen { max-width:380px; margin:0 auto; padding:70px 24px; text-align:center; }
.screen input { width:100%; border:1px solid var(--line); background:var(--card); color:var(--text); border-radius:12px;
  padding:13px; font-size:16px; margin:6px 0; }
.logo { width:76px; height:76px; border-radius:22px; background:var(--g); margin:0 auto 16px; display:grid; place-items:center; font-size:36px; }
.muted { color:var(--muted); }
.small { font-size:13px; }
.err { color:var(--red); min-height:20px; }
.big { font-size:22px; }
.vname { margin:14px 2px 4px; font-size:22px; }
.vline { margin:2px 2px; color:var(--muted); font-size:15px; }
.vprice { margin:6px 2px; font-size:20px; font-weight:700; }
.vline:empty, .vprice:empty { display:none; }
.shop { display:block; text-align:center; text-decoration:none; color:#fff; background:var(--link); margin:10px 0 4px; }
.chev { color:var(--muted); font-size:22px; padding:0 2px; cursor:pointer; }
.pill { border:0; background:var(--g); color:#fff; font-weight:600; font-size:14px; padding:8px 14px; border-radius:999px; }
.hint { color:var(--muted); font-size:13px; margin:8px 4px 0; }
.histscreen { position:fixed; inset:0; z-index:8; background:var(--bg); overflow:auto; }
.histscreen .add { margin-top:4px; }
.trip { margin-top:14px; }
.triph { font-size:13px; color:var(--muted); margin:0 6px 6px; }
.readd { border:0; background:var(--bg); border-radius:10px; width:36px; height:36px; font-size:20px; flex:none; }
.toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); background:#222; color:#fff; padding:10px 16px;
  border-radius:12px; z-index:20; font-size:14px; }
.sheettop { display:flex; align-items:center; justify-content:space-between; margin:-4px -4px 8px; }
.sheettop .grab { margin:0; }
.backbtn { display:inline-flex; align-items:center; gap:4px; border:1px solid var(--line); background:var(--bg); color:var(--text);
  font-size:17px; font-weight:700; padding:9px 16px 9px 12px; border-radius:999px; }
.backspacer { min-width:96px; }
/* sub-lists (2026-10-25) */
.group { margin-top:14px; }
.group + .group { margin-top:26px; padding-top:18px; border-top:2px dashed var(--line); }
.ghead { display:flex; align-items:center; gap:8px; margin:0 4px 8px; }
.ghead h2 { margin:0; font-size:19px; flex:1; }
.gcount { color:var(--muted); font-size:13px; }
.newgroup { display:block; width:100%; margin-top:22px; border:2px dashed var(--line); background:none; color:var(--muted);
  border-radius:14px; padding:13px; font-size:15px; font-weight:600; }
/* offline + drag (2026-10-25) */
.offline { background:#b45309; color:#fff; text-align:center; font-size:14px; padding:8px 12px; }
.drag { touch-action:none; cursor:grab; color:var(--muted); font-size:22px; padding:6px 2px 6px 0; margin-right:-4px; user-select:none; }
.item.dragging { position:relative; z-index:3; background:var(--card); box-shadow:0 8px 24px rgba(0,0,0,.25); opacity:.95; }
.item.dragging .drag { cursor:grabbing; color:var(--g); }
