:root {
  --green: #2e7d32;
  --grey: #9e9e9e;
  --line: #e0e0e0;
  --bg: #fafafa;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --line: #333; --bg: #121212; --grey: #777; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
#app, #login { max-width: 640px; margin: 0 auto; padding: 0 12px env(safe-area-inset-bottom); }

#login { padding-top: 20vh; text-align: center; }
#login form { display: flex; flex-direction: column; gap: 10px; }
.error { color: #c62828; min-height: 1.2em; }

header { position: sticky; top: 0; background: var(--bg); padding: 12px 0 4px; z-index: 1; }
#add-form { display: flex; gap: 8px; }
input, button { font: inherit; font-size: 1.05rem; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
input { flex: 1; min-width: 0; background: transparent; color: inherit; }
button { background: var(--green); color: #fff; border: none; cursor: pointer; }
#add-form button { width: 48px; font-size: 1.4rem; padding: 0; }

#suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
#suggestions button { background: transparent; color: inherit; border: 1px solid var(--line); padding: 4px 10px; font-size: .95rem; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: .85rem; color: var(--grey); }
.toolbar button { background: transparent; color: var(--green); padding: 4px 0; font-size: .9rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.list .box { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--green); flex: none; }
.list .name { flex: 1; font-size: 1.1rem; }
.list .meta { font-size: .8rem; color: var(--grey); white-space: nowrap; }
.list .del { display: none; background: #c62828; padding: 4px 10px; font-size: .9rem; }
body.editing .list .del { display: inline-block; }

.done li { color: var(--grey); }
.done .box { border-color: var(--grey); background: var(--grey); }
.done .name { text-decoration: line-through; }
li.flash { animation: flash 1s; }
@keyframes flash { from { background: #c8e6c9; } to { background: transparent; } }

h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--grey); margin: 24px 4px 4px; }
.empty { color: var(--grey); padding: 12px 4px; }
footer { text-align: center; padding: 32px 0; }
footer button { background: transparent; color: var(--grey); font-size: .85rem; }
