:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#111827;background:#f5f6f8;--muted:#6b7280;--line:#e5e7eb;--card:#fff;--blue:#2563eb;--red:#dc2626;--green:#16a34a}
*{box-sizing:border-box}body{margin:0;background:#f5f6f8}button,input,textarea,select{font:inherit}button{border:0;background:none;cursor:pointer}
#app{max-width:720px;margin:auto;min-height:100vh;padding-bottom:76px}header{position:sticky;top:0;z-index:3;background:rgba(245,246,248,.94);backdrop-filter:blur(12px);padding:22px 18px 14px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #eee}
.eyebrow{font-size:11px;font-weight:700;letter-spacing:1.3px;color:var(--muted)}h1{font-size:30px;margin:4px 0 0}.headerActions{display:flex;gap:8px}.iconBtn,.notifyBtn{width:42px;height:42px;border-radius:14px;border:1px solid var(--line);font-size:22px}.iconBtn{background:#111827;color:#fff}.notifyBtn{background:#fff}.notifyBtn.enabled{background:#ecfdf5;border-color:#bbf7d0}
main{padding:16px}.view{display:none}.view.active{display:block}.sectionTitle{font-size:13px;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.7px;margin:14px 4px 8px}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:14px;margin:9px 0;box-shadow:0 1px 2px #00000008}.task{display:flex;gap:12px;align-items:flex-start}.check{width:24px;height:24px;border:2px solid #cbd5e1;border-radius:50%;flex:0 0 24px}.check.done{background:var(--green);border-color:var(--green);color:#fff}.check.done:after{content:"✓";display:block;text-align:center;line-height:20px}.taskBody{flex:1;min-width:0}.taskName{font-weight:650;line-height:1.3}.doneText{text-decoration:line-through;color:#9ca3af}.meta{font-size:12px;color:var(--muted);margin-top:5px}.overdue .meta{color:var(--red);font-weight:650}.taskActions{display:flex;gap:2px;align-items:flex-start;flex-wrap:wrap;justify-content:flex-end}.smallBtn{font-size:12px;color:var(--muted);padding:5px}.priority-high{border-left:4px solid #f59e0b}.priority-urgent{border-left:4px solid #dc2626}.minimum{font-size:12px;color:var(--muted);margin-top:5px}.reminder{display:inline-block;margin-top:6px;padding:3px 7px;border-radius:7px;background:#eff6ff;color:#2563eb;font-size:11px;font-weight:700}
.empty{padding:38px 16px;text-align:center;color:var(--muted)}.empty strong{display:block;color:#374151;margin-bottom:6px}
.focusCard{background:#111827;color:#fff;border-radius:18px;padding:18px;margin-bottom:16px}.focusLabel{font-size:11px;letter-spacing:1px;font-weight:800;opacity:.7}.focusName{font-size:22px;font-weight:750;margin:7px 0}.focusMeta{font-size:13px;opacity:.75}.focusActions{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}.focusActions button{background:#fff;color:#111827;padding:10px 13px;border-radius:10px;font-weight:700}.focusActions .secondary{background:#374151;color:#fff}.capacity{font-size:12px;color:var(--muted);margin:8px 2px 14px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.capacity.over{color:#b91c1c;background:#fef2f2;border:1px solid #fecaca;border-radius:12px;padding:10px 12px}
.project{padding:16px}.projectTop{display:flex;justify-content:space-between}.projectName{font-size:18px;font-weight:750}.projectDesc{font-size:13px;color:var(--muted);margin-top:4px}.nextAction{font-size:13px;margin-top:8px;padding:8px 10px;background:#f5f6f8;border-radius:10px}.progress{height:7px;background:#eef0f3;border-radius:99px;margin:14px 0 8px;overflow:hidden}.bar{height:100%;background:#111827;border-radius:99px}.progressText{font-size:12px;color:var(--muted)}.projectActions{display:flex;gap:6px;margin-top:12px;flex-wrap:wrap}.projectsToolbar{display:flex;gap:8px;margin-bottom:6px}.projectsToolbar .primary{margin-top:0;flex:1}.projectsToolbar .outline{margin-top:0}.outline{border:1px solid var(--line);padding:8px 11px;border-radius:10px;font-size:13px;background:#fff}.danger{color:var(--red)}
.primary{width:100%;padding:13px;border-radius:12px;background:#111827;color:#fff;font-weight:700;margin-top:10px}.muted{color:var(--muted);font-size:13px}.muted.small{font-size:11px;margin-top:8px}.timeGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0}.timeGrid button{padding:14px;border:1px solid var(--line);border-radius:12px;background:#fff;font-weight:700}
.tabbar{position:fixed;bottom:0;left:0;right:0;height:68px;background:rgba(255,255,255,.96);backdrop-filter:blur(14px);border-top:1px solid var(--line);display:flex;justify-content:center;z-index:5}.tab{width:33%;max-width:240px;color:#9ca3af;font-weight:650}.tab.active{color:#111827}.tab span:before{display:block;font-size:20px;margin-bottom:2px}.tab[data-tab=today] span:before{content:"◷"}.tab[data-tab=projects] span:before{content:"▦"}.tab[data-tab=review] span:before{content:"▤"}
.modal{position:fixed;inset:0;background:#0007;z-index:10;display:flex;align-items:flex-end}.hidden{display:none}.sheet{background:#fff;width:100%;max-width:720px;margin:auto;border-radius:24px 24px 0 0;padding:20px 18px calc(22px + env(safe-area-inset-bottom));max-height:90vh;overflow:auto}.sheetHead{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.sheet h2{margin:0;font-size:21px}.closeBtn{font-size:30px;color:#6b7280}.sheet label{display:block;font-size:13px;font-weight:650;margin:14px 0}.sheet input,.sheet select,.sheet textarea{display:block;width:100%;margin-top:7px;padding:12px;border:1px solid #d7dbe2;border-radius:11px;background:#fff;outline:none}.row2{display:grid;grid-template-columns:1.4fr 1fr;gap:10px}

/* ---- added for cloud sync / V4 / V5 ---- */
.iconBtn.ghost{background:#fff;color:#111827}
.stackButtons{display:flex;flex-direction:column;gap:10px;margin:16px 0}.stackButtons button{text-align:left;padding:14px;border:1px solid var(--line);border-radius:12px;background:#fff;font-weight:650}
.breakdownRow{margin:8px 0}
.linkBtn{color:var(--blue);font-weight:700;font-size:13px;padding:6px 0}
.linkLight{color:#fff;text-decoration:underline;font-size:12px;font-weight:600;opacity:.85;padding:0}
.toast{position:fixed;left:50%;bottom:92px;transform:translate(-50%,12px);background:#111827;color:#fff;padding:11px 16px;border-radius:12px;font-size:13px;font-weight:600;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:20;max-width:88%;text-align:center;box-shadow:0 6px 18px #0003}.toast.show{opacity:1;transform:translate(-50%,0)}

details#cloudSetupDetails{margin:14px 0;border:1px solid var(--line);border-radius:12px;padding:4px 12px}details#cloudSetupDetails summary{padding:12px 0;font-weight:650;font-size:13px;cursor:pointer;list-style:none}details#cloudSetupDetails summary::-webkit-details-marker{display:none}details#cloudSetupDetails[open] summary{border-bottom:1px solid var(--line)}details#cloudSetupDetails label{margin:12px 0}

.planRow{display:flex;gap:12px;align-items:flex-start;padding:12px;border:1px solid var(--line);border-radius:12px;margin:8px 0;cursor:pointer}.planRow input{width:auto;margin-top:3px}
.planFooter{position:sticky;bottom:0;background:#fff;padding-top:12px;margin-top:6px;display:flex;align-items:center;justify-content:space-between;gap:10px}.planFooter .primary{margin-top:0;width:auto;padding:12px 18px}
.overText{color:var(--red);font-weight:700}

.statsRow{display:flex}.stat{flex:1;text-align:center;padding:6px}.statNum{font-size:26px;font-weight:800}.statLabel{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;margin-top:2px}
.loadChart{display:flex;align-items:flex-end;gap:8px;height:100px;padding-top:10px}.loadBarWrap{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%}.loadBar{width:100%;max-width:28px;background:#111827;border-radius:6px 6px 2px 2px}.loadBar.over{background:var(--red)}.loadBarLabel{font-size:10px;color:var(--muted);margin-top:6px}
.insightRow{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 2px;border-bottom:1px solid var(--line)}.insightRow:last-child{border-bottom:none}
