:root { --bg:#faf8f5; --side:#f3efe8; --card:#fff; --ink:#1f1d1a; --muted:#7a746b; --line:#e8e3da;
        --accent:#b8862b; --accent-soft:#f6ecd8; --ok:#2f7d4f; --warn:#b44a2c; }
* { box-sizing:border-box; }
html, body { margin:0; height:100%; }
body { background:var(--bg); color:var(--ink); font:15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
[hidden] { display:none !important; }
.muted { color:var(--muted); }
.center { min-height:100%; display:flex; align-items:center; justify-content:center; padding:24px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:16px; padding:24px 28px; max-width:460px; }
.card h1 { margin:0 0 8px; font-size:22px; }

#app { display:grid; grid-template-columns:270px 1fr; min-height:100%; }
#side { background:var(--side); border-right:1px solid var(--line); padding:20px 14px; position:sticky; top:0; height:100vh; overflow-y:auto; display:flex; flex-direction:column; gap:6px; }
.brand { font-weight:700; font-size:18px; padding:0 8px 8px; }
#q { width:100%; padding:9px 12px; border:1px solid var(--line); border-radius:10px; font:inherit; background:#fff; margin-bottom:8px; }
nav { display:flex; flex-direction:column; gap:2px; }
.navtitle { font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); padding:14px 10px 4px; }
.navbtn { display:flex; justify-content:space-between; align-items:center; gap:8px; width:100%; text-align:left; border:0; background:none; font:inherit; color:inherit; padding:7px 10px; border-radius:9px; cursor:pointer; }
.navbtn:hover { background:#ebe5da; }
.navbtn.active { background:var(--accent-soft); font-weight:600; }
.count { color:var(--muted); font-size:13px; font-weight:400; }
.sidefoot { margin-top:auto; padding-top:16px; display:flex; justify-content:space-between; align-items:center; }
#refresh { border:1px solid var(--line); background:#fff; border-radius:9px; padding:6px 10px; font:inherit; cursor:pointer; }
.link { border:0; background:none; color:var(--muted); font:inherit; cursor:pointer; text-decoration:underline; }

main { padding:28px 36px 60px; max-width:980px; width:100%; }
header h1 { margin:0; font-size:26px; }
header p { margin:4px 0 18px; }
.group { margin:22px 0 8px; font-size:13px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:600; }
.group.warn { color:var(--warn); }
.item { display:flex; gap:12px; align-items:flex-start; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:11px 14px; margin:6px 0; }
.item.done .text { color:var(--muted); text-decoration:line-through; }
.check { width:22px; height:22px; border:2px solid #cfc7b8; border-radius:7px; flex:none; cursor:pointer; background:#fff; margin-top:1px; display:flex; align-items:center; justify-content:center; font-size:14px; color:#fff; padding:0; }
.check:hover { border-color:var(--ok); }
.check.on { background:var(--ok); border-color:var(--ok); }
.icon { width:22px; flex:none; text-align:center; }
.body { flex:1; min-width:0; }
.text { word-wrap:break-word; }
.meta { display:flex; flex-wrap:wrap; gap:6px 10px; margin-top:3px; font-size:13px; color:var(--muted); }
.chip { background:var(--accent-soft); color:#7a5a17; border-radius:20px; padding:0 8px; }
.late { color:var(--warn); font-weight:600; }
.high { color:var(--warn); }
.actions { display:flex; gap:8px; flex:none; }
.actions button { border:0; background:none; color:var(--muted); cursor:pointer; font:inherit; font-size:13px; padding:2px 4px; }
.actions button:hover { color:var(--ink); text-decoration:underline; }
details.result { margin-top:6px; }
details.result summary { cursor:pointer; color:var(--accent); font-size:13px; }
details.result pre { white-space:pre-wrap; font:inherit; background:var(--bg); border-radius:8px; padding:10px; margin:6px 0 0; }
.msg { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:11px 14px; margin:6px 0; }
.msg .meta { margin:0 0 4px; }
.msg .text { white-space:pre-wrap; }
.empty { color:var(--muted); padding:30px 0; }
.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:#2b2925; color:#fff; padding:9px 16px; border-radius:10px; font-size:14px; }

@media (max-width: 760px) {
  #app { grid-template-columns:1fr; }
  #side { position:static; height:auto; border-right:0; border-bottom:1px solid var(--line); padding:12px; }
  nav { flex-direction:row; overflow-x:auto; gap:6px; padding-bottom:2px; }
  .navbtn { width:auto; white-space:nowrap; background:#fff; border:1px solid var(--line); }
  .navtitle { display:none; }
  .sidefoot { display:none; }
  .brand { display:none; }
  main { padding:16px 14px 40px; }
  header h1 { font-size:21px; }
}
