:root{--bg:#f4f5f7;--card:#fff;--text:#1f2430;--muted:#6b7280;--line:#e5e7eb;--accent:#3b82f6;
--q1:#e5484d;--q2:#3b82f6;--q3:#f59e0b;--q4:#9ca3af;--radius:14px}
@media (prefers-color-scheme:dark){:root{--bg:#12141a;--card:#1b1e27;--text:#e8eaf0;--muted:#9aa1b0;--line:#2a2e3a}}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;background:var(--bg);color:var(--text);min-height:100vh}
.hidden{display:none!important}.muted{color:var(--muted);font-size:.85rem}.center{text-align:center;justify-content:center}
.err{color:var(--q1);font-size:.85rem;min-height:1.2em}
button{font:inherit;border:none;border-radius:8px;padding:8px 14px;background:var(--accent);color:#fff;font-weight:600;cursor:pointer}
button:hover{filter:brightness(1.1)}
button.ghost{background:transparent;color:var(--text);border:1px solid var(--line)}
button.danger{color:var(--q1)}
input,textarea,select{font:inherit;color:var(--text);background:var(--card);border:1px solid var(--line);border-radius:8px;padding:8px 10px;outline:none}
input:focus,textarea:focus{border-color:var(--accent)}
.row{display:flex;gap:8px;align-items:center}.row.between{justify-content:space-between}
.login{display:grid;place-items:center;min-height:100vh;padding:20px}
.login-card{background:var(--card);padding:28px;border-radius:var(--radius);width:min(360px,100%);display:flex;flex-direction:column;gap:12px;box-shadow:0 2px 10px rgba(0,0,0,.1)}
.topbar{display:flex;align-items:center;gap:16px;padding:12px 20px;background:var(--card);border-bottom:1px solid var(--line);flex-wrap:wrap}
.topbar h1{font-size:1.2rem}.topbar nav{display:flex;gap:6px;flex:1}
.tab{background:transparent;color:var(--muted)}.tab.active{background:var(--accent);color:#fff}
.panel{max-width:1100px;margin:0 auto;padding:20px}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.quadrant{background:var(--card);border-radius:var(--radius);border-top:5px solid var(--accent);padding:14px;display:flex;flex-direction:column;min-height:260px}
.quadrant.over{outline:2px dashed var(--accent)}
.quadrant h2{font-size:1rem}.quadrant .sub{font-size:.78rem;color:var(--muted);margin:2px 0 8px}
.tasks{list-style:none;flex:1;overflow-y:auto;max-height:340px}
.task{display:flex;gap:8px;align-items:flex-start;padding:8px 4px;border-bottom:1px solid var(--line);cursor:grab}
.task input[type=checkbox]{margin-top:4px;accent-color:var(--accent)}
.task .label{flex:1;word-break:break-word;font-size:.92rem}
.task.done .label{text-decoration:line-through;color:var(--muted)}
.due{font-size:.72rem;color:var(--muted);white-space:nowrap}.due.late{color:var(--q1);font-weight:600}
.task select{font-size:.72rem;padding:2px}
.task .del{background:none;color:var(--muted);padding:0 4px}
.add{display:flex;gap:6px;margin-top:10px}.add input[type=text]{flex:1;min-width:0}.add input[type=date]{width:130px}
.foot{display:flex;justify-content:space-between;align-items:center;margin-top:14px;color:var(--muted);font-size:.85rem}
.notes-layout{display:grid;grid-template-columns:280px 1fr;gap:16px;min-height:70vh}
.notes-list{background:var(--card);border-radius:var(--radius);padding:12px;display:flex;flex-direction:column;gap:10px}
.notes-list input{flex:1;min-width:0}
#note-items{list-style:none;overflow-y:auto;max-height:65vh}
#note-items li{padding:8px;border-radius:8px;cursor:pointer}
#note-items li:hover,#note-items li.active{background:var(--bg)}
#note-items b{display:block;font-size:.9rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#note-items small{color:var(--muted)}
.note-editor{background:var(--card);border-radius:var(--radius);padding:14px}
#note-form{display:flex;flex-direction:column;gap:10px;height:100%}
#note-title{font-size:1.2rem;font-weight:600}
#note-body{flex:1;min-height:55vh;resize:vertical;line-height:1.5}
.focus-wrap{max-width:520px;margin:0 auto;display:flex;flex-direction:column;gap:16px;align-items:stretch}
.modes{display:flex;gap:6px;justify-content:center}
.mode{background:transparent;color:var(--muted);border:1px solid var(--line)}.mode.active{background:var(--accent);color:#fff}
.clock{font-size:5.5rem;font-weight:700;text-align:center;font-variant-numeric:tabular-nums}
.bars{display:flex;gap:8px;align-items:flex-end;height:110px}
.bar{flex:1;text-align:center;font-size:.7rem;color:var(--muted)}
.bar i{display:block;background:var(--accent);border-radius:4px 4px 0 0;min-height:2px;margin-bottom:4px}
.settings label{display:flex;flex-direction:column;font-size:.8rem;gap:2px}.settings input{width:70px}
.settings .row{margin-top:10px;align-items:flex-end}
@media(max-width:760px){.grid{grid-template-columns:1fr}.notes-layout{grid-template-columns:1fr}.clock{font-size:4rem}.panel{padding:12px}}
