:root {
  color-scheme: light dark;
  --bg: #14161a;
  --fg: #e8e6e1;
  --muted: #9aa0a6;
  --line: #2a2e35;
  --accent: #c8a24a;
  --danger: #e5695f;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f6f6f4; --fg: #1b1d21; --muted: #5d636b; --line: #d9d9d4; }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem
          max(1.5rem, env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
.auth { max-width: 22rem; margin: 12vh auto 0; }
h1 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); font-weight: 600; margin: 0 0 1.5rem;
}
label {
  display: block; margin: 1rem 0 0.35rem;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
}
input {
  width: 100%; padding: 0.75rem; font-size: 1rem;
  background: transparent; color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
button {
  width: 100%; margin-top: 1.5rem; padding: 0.85rem;
  font-size: 1rem; font-weight: 600;
  background: var(--accent); color: #14161a;
  border: 0; border-radius: 8px; cursor: pointer;
}
.error, .locked {
  padding: 0.75rem; border-radius: 8px; font-size: 0.9rem;
  border: 1px solid var(--danger); color: var(--danger);
}
.locked { border-color: var(--muted); color: var(--muted); }

.bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem 1.1rem;
  padding-top: max(0.9rem, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
}
.bar.bottom {
  position: sticky; bottom: 0; top: auto;
  border-bottom: 0; border-top: 1px solid var(--line);
  padding-bottom: max(0.9rem, env(safe-area-inset-bottom));
  justify-content: flex-end;
}
.brand { color: var(--fg); font-weight: 600; }
.stat { color: var(--accent); }
.list { max-width: 44rem; margin: 0 auto; padding: 0.5rem 0 2rem; }
.list section { margin: 1.75rem 0 0; }
.list h2 {
  display: flex; align-items: baseline; gap: 0.6rem;
  margin: 0 0 0.5rem; padding: 0 1.1rem;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); font-weight: 600;
}
.list h2 .count {
  font-size: 0.68rem; color: var(--accent);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.45rem;
}
.list ul { list-style: none; margin: 0; padding: 0; }
.item { border-top: 1px solid var(--line); }
.item:last-child { border-bottom: 1px solid var(--line); }
.item form { margin: 0; }
.tick {
  display: flex; gap: 0.85rem; align-items: flex-start;
  width: 100%; margin: 0; padding: 0.95rem 1.1rem;
  background: none; border: 0; border-radius: 0;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  /* Comfortable thumb target on a phone. */
  min-height: 3rem;
}
.tick:active { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.box {
  flex: 0 0 auto; width: 1.35rem; height: 1.35rem; margin-top: 0.1rem;
  border: 1.5px solid var(--muted); border-radius: 6px;
  display: grid; place-items: center;
  font-size: 0.85rem; line-height: 1; color: var(--accent);
}
.item.done .box { border-color: var(--accent); }
.text { flex: 1; line-height: 1.45; }
.item.done .text { color: var(--muted); text-decoration: line-through; }
.text strong { color: var(--accent); font-weight: 600; }
.text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em; padding: 0.05em 0.3em;
  border: 1px solid var(--line); border-radius: 4px;
}
.wikilink { color: var(--muted); }
.flash {
  margin: 0.75rem 1.1rem; padding: 0.7rem 0.9rem;
  border: 1px solid var(--accent); border-radius: 8px;
  color: var(--accent); font-size: 0.9rem;
}
.empty { padding: 2rem 1.1rem; color: var(--muted); }
.rules { margin: 2rem 1.1rem 0; color: var(--muted); font-size: 0.85rem; }
.rules summary {
  cursor: pointer; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 0.72rem;
}
.rules ul { margin: 0.75rem 0 0; padding-left: 1.1rem; }
.rules li { margin: 0.4rem 0; }
.add { margin: 2rem 1.1rem 0; }
.add summary {
  cursor: pointer; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.72rem; font-weight: 600;
}
.add form { margin-top: 0.85rem; }
.add input[type="text"] {
  width: 100%; padding: 0.75rem; font-size: 1rem;
  background: transparent; color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px;
}
.add .row { display: flex; gap: 0.6rem; margin-top: 0.6rem; }
.add select {
  flex: 1; min-width: 0; padding: 0.7rem;
  font-size: 0.95rem; background: transparent; color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px;
}
.add button {
  flex: 0 0 auto; padding: 0.7rem 1.1rem;
  font-size: 0.95rem; font-weight: 600;
  background: var(--accent); color: #14161a;
  border: 0; border-radius: 8px; cursor: pointer;
}
button.link {
  background: none; border: 0; color: var(--muted);
  font: inherit; text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.72rem; cursor: pointer; padding: 0;
}
