:root {
  --bg: #f6f6f4; --card: #fff; --text: #1d1d1b; --muted: #77776f;
  --line: #e4e4df; --accent: #2f6fed; --danger: #c93c3c;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151514; --card: #1f1f1d; --text: #ecece8; --muted: #9a9a92; --line: #333330; --accent: #6b9bff; --danger: #ef7070; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, sans-serif; }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
header { display: flex; align-items: center; justify-content: space-between; }
h1 { font-size: 1.6rem; margin: 8px 0 16px; }
#login { text-align: center; padding-top: 20vh; }
#demo-banner { background: #ffe9a8; color: #5a4500; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-size: .9rem; }

#add-form { display: flex; gap: 8px; margin-bottom: 16px; }
input[type=text] { flex: 1; min-width: 0; padding: 12px; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 10px 14px; background: transparent; color: var(--text); }
button.primary { background: var(--accent); color: #fff; }
button.link { color: var(--muted); text-decoration: underline; padding: 4px; }
.error { color: var(--danger); }

#list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.handle { cursor: grab; color: var(--muted); touch-action: none; user-select: none; padding: 4px; }
.body { flex: 1; min-width: 0; }
.text { word-break: break-word; }
.item.done .text { text-decoration: line-through; color: var(--muted); }
.date { font-size: .75rem; color: var(--muted); }
.item input[type=checkbox] { width: 20px; height: 20px; flex: none; }
.item input[type=text] { width: 100%; padding: 6px 8px; }
.icon { padding: 6px 8px; color: var(--muted); }
.icon.del:hover { color: var(--danger); }
.sortable-ghost { opacity: .4; }
