:root {
  --bg: #F7F8FA; --card: #FFFFFF; --ink: #1B2334; --muted: #6A7488;
  --line: #DEE3EC; --accent: #1A5FB4; --accent-ink: #FFFFFF;
  --done: #8A94A8; --chip: #EDF2FA; --danger: #B3402E;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171F; --card: #1C212C; --ink: #E8EBF2; --muted: #939DB3;
    --line: #2C3444; --accent: #6FA1E8; --accent-ink: #10131A;
    --done: #5E687D; --chip: #252D3D; --danger: #E08B77;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif; font-size: 1rem; line-height: 1.5;
}
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.brand { font-size: 1.15rem; }
.who { color: var(--muted); font-size: 0.85rem; }
main { max-width: 40rem; margin: 0 auto; padding: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; }
.center { text-align: center; margin-top: 15vh; }
h1 { font-size: 1.4rem; margin: 0 0 0.4rem; }
h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 1.4rem 0 0.5rem; }
.muted { color: var(--muted); }
button { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 0.5rem 0.9rem; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

#add-form { display: flex; gap: 0.5rem; }
#add-title { flex: 1; font: inherit; padding: 0.55rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); min-width: 0; }
#add-vis { font: inherit; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); padding: 0 0.4rem; }

.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.item {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem 0.8rem;
}
.item input[type=checkbox] { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); flex-shrink: 0; }
.item .title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.items.done .title { text-decoration: line-through; color: var(--done); }
.meta { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.chip {
  font-size: 0.75rem; background: var(--chip); color: var(--accent);
  border: none; border-radius: 99px; padding: 0.25rem 0.65rem; white-space: nowrap;
}
.chip.private { color: var(--muted); }
.del { border: none; background: none; color: var(--muted); font-size: 1rem; padding: 0.2rem 0.4rem; }
.del:hover { color: var(--danger); }
.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); border-radius: 99px; padding: 0.5rem 1.1rem;
  font-size: 0.9rem; box-shadow: 0 4px 16px rgba(0,0,0,0.25); z-index: 10;
}
@media (prefers-reduced-motion: no-preference) {
  .item { transition: opacity 0.15s ease; }
}
