:root {
  --paper: #f6f1e6; --sheet: #fffdf7; --ink: #232019; --muted: #7a7263;
  --rule: #d9cfbb; --margin: #d46a5a; --accent: #2b4c7e; --accent-ink: #fff;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16150f; --sheet: #211f18; --ink: #ece6d6; --muted: #9b9381;
    --rule: #3a362b; --margin: #b0564a; --accent: #8fb0e6; --accent-ink: #14130f;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; padding: 2rem 1rem;
}
.pad {
  max-width: 36rem; margin: 0 auto; background: var(--sheet);
  border: 1px solid var(--rule); border-radius: 4px;
  padding: 1.75rem 1.5rem 1.25rem 3.25rem; position: relative;
  box-shadow: 0 1px 0 var(--rule), 0 12px 30px -18px rgba(0,0,0,.35);
}
.pad::before { content: ""; position: absolute; top: 0; bottom: 0; left: 2.25rem; width: 2px; background: var(--margin); opacity: .55; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
h1 { font: 600 2.25rem/1.1 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; margin: 0; letter-spacing: -.01em; }
.count { color: var(--muted); margin: 0; font-variant-numeric: tabular-nums; }
form { display: flex; gap: .5rem; margin: 1.5rem 0 .5rem; }
input {
  flex: 1; min-width: 0; font: inherit; color: inherit; background: transparent;
  border: 0; border-bottom: 2px solid var(--rule); padding: .5rem .1rem; outline: none;
}
input:focus { border-bottom-color: var(--accent); }
button { font: inherit; cursor: pointer; }
form button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 3px; padding: .5rem 1.1rem; font-weight: 600; }
form button:disabled { opacity: .6; cursor: default; }
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; gap: .75rem; min-height: 2.9rem;
  border-bottom: 1px solid var(--rule); padding: .25rem 0;
}
.list input[type=checkbox] { flex: none; width: 1.2rem; height: 1.2rem; accent-color: var(--accent); margin: 0; cursor: pointer; }
.list .title { flex: 1; overflow-wrap: anywhere; }
.list li.done .title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--margin); text-decoration-thickness: 2px; }
.list .del { background: none; border: 0; color: var(--muted); font-size: 1.3rem; line-height: 1; padding: .25rem .5rem; border-radius: 3px; opacity: .55; }
.list li:hover .del, .list .del:focus-visible { opacity: 1; }
.list .del:hover { color: var(--margin); }
.empty { color: var(--muted); font-style: italic; margin: 1.25rem 0; }
.error { color: var(--margin); margin: .25rem 0 .75rem; }
footer { min-height: 1.5rem; margin-top: 1rem; text-align: right; }
.link { background: none; border: 0; color: var(--accent); padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 480px) {
  body { padding: 1rem .5rem; }
  .pad { padding: 1.25rem 1rem 1rem 2.5rem; }
  .pad::before { left: 1.6rem; }
  h1 { font-size: 1.8rem; }
}
