:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a1c1e;
  --muted: #71757a;
  --accent: #2f6fed;
  --danger: #d9534f;
  --ok: #3fa34d;
  --border: #e3e5e8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --card: #1d1f22;
    --text: #e8eaed;
    --muted: #9aa0a6;
    --accent: #6c9dff;
    --danger: #ff7b78;
    --ok: #66c277;
    --border: #2c2f33;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 16px 0 8px; }
.muted { color: var(--muted); font-size: 14px; }
.ghost {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  padding: 6px 8px;
  cursor: pointer;
}
.hidden { display: none; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}
.tile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
}
.tile .emoji { font-size: 22px; }
.tile .count { margin-left: auto; color: var(--muted); font-size: 14px; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.row .text { flex: 1; font-size: 15px; }
.row .meta { color: var(--muted); font-size: 12px; }
.row.done .text { text-decoration: line-through; color: var(--muted); }
.row button {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
}

input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  margin-bottom: 8px;
}
button.primary {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  background: var(--text);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.toast.show { opacity: .95; }
