:root {
  color-scheme: light dark;
  --bg: #fafafa;
  --fg: #1c1c1e;
  --muted: #6b6b70;
  --line: #e0e0e4;
  --accent: #2563eb;
  --err: #c62828;
  --ok: #2e9e4f;
  --warn: #d99a00;
  --off: #9a9aa0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --fg: #ececf0;
    --muted: #9a9aa2;
    --line: #2c2c31;
    --accent: #6d9bff;
    --err: #ff7b72;
    --ok: #4cc26b;
    --warn: #f0b429;
    --off: #6e6e75;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, sans-serif;
}
main { max-width: 560px; margin: 0 auto; padding: 16px; }
header { display: flex; align-items: center; justify-content: space-between; }
h1 { font-size: 1.25rem; margin: 0 0 12px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--off); }
.dot[data-state="synced"] { background: var(--ok); }
.dot[data-state="syncing"] { background: var(--warn); }
.dot[data-state="offline"] { background: var(--off); }
form { display: flex; gap: 8px; margin-bottom: 12px; }
#token-form { flex-wrap: wrap; }
#token-form p { flex-basis: 100%; margin: 0; }
input, button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
input { flex: 1; min-width: 0; }
button { cursor: pointer; }
button[type="submit"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.error { color: var(--err); margin: 0 0 8px; }
ul { list-style: none; margin: 0; padding: 0; }
li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.body { flex: 1; min-width: 0; cursor: text; }
.check {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid var(--muted);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.check[aria-pressed="true"] {
  background: var(--ok);
  border-color: var(--ok);
}
.check[aria-pressed="true"]::after {
  content: "✓";
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
}
.edit { width: 100%; padding: 4px 8px; }
.text { display: block; overflow-wrap: anywhere; }
.when { display: block; font-size: 0.75rem; color: var(--muted); }
li.done .text { text-decoration: line-through; color: var(--muted); }
.del { border: 0; color: var(--muted); font-size: 1.25rem; line-height: 1; padding: 6px 10px; }
[hidden] { display: none !important; }
