:root {
  --bg: #f7f7f8;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --accent: #c0392b;
  --line: #dcdce0;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161618;
    --fg: #f2f2f4;
    --muted: #a1a1a6;
    --line: #3a3a3f;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, sans-serif;
}

main {
  max-width: 40rem;
  margin: 3rem auto;
  padding: 0 1rem;
}

h1 {
  margin: 0;
}

.meta {
  margin: 0.25rem 0 1.5rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

form {
  display: flex;
  gap: 0.5rem;
}

input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
}

button {
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

ul {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

li span {
  flex: 1;
  overflow-wrap: anywhere;
}

li.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.error {
  min-height: 1.5rem;
  margin: 0.5rem 0 0;
  color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
