:root {
  color-scheme: light dark;
  --gap: 0.75rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: 40rem;
  padding: var(--gap);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.site-header h1 {
  font-size: 1.25rem;
}

.site-header a {
  color: inherit;
  text-decoration: none;
}

form {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
}

input[type="text"] {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.5rem;
  font: inherit;
}

button {
  padding: 0.5rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

.lists {
  list-style: none;
  margin: var(--gap) 0 0;
  padding: 0;
}

.list-item {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 0.5rem 0;
  border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.list-item .list-name {
  flex: 1 1 auto;
}

.list-item.editing form {
  flex: 1 1 auto;
}

.empty-state {
  padding: var(--gap) 0;
  opacity: 0.7;
}

.breadcrumb {
  margin: 0;
  font-size: 0.9rem;
}

textarea {
  flex: 1 1 100%;
  min-width: 0;
  padding: 0.5rem;
  font: inherit;
  resize: vertical;
}

.task-list {
  list-style: none;
  margin: var(--gap) 0 0;
  padding: 0;
}

.task-item {
  display: flex;
  align-items: baseline;
  gap: var(--gap);
  padding: 0.5rem 0;
  border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.task-item .task-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.task-item.is-completed .task-title {
  text-decoration: line-through;
  opacity: 0.7;
}

.task-note {
  /* Notes are free text: the line breaks the user typed are kept. */
  white-space: pre-wrap;
  font-size: 0.9rem;
  opacity: 0.8;
}

.completed-at {
  font-size: 0.8rem;
  opacity: 0.7;
}

.task-item.editing form {
  flex: 1 1 auto;
}

.completed-panel {
  margin-top: calc(var(--gap) * 2);
}
