/* Minimal: nero su bianco o bianco su nero. Il colore (--accent) serve solo per ciò che conta. */
:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #8a8a8a;
  --line: #e6e6e6;
  --accent: #ff3b00;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --fg: #ffffff;
  --muted: #7a7a7a;
  --line: #222222;
  --accent: #ff5a2a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --fg: #ffffff;
    --muted: #7a7a7a;
    --line: #222222;
    --accent: #ff5a2a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
}

header, main { max-width: 520px; margin: 0 auto; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 14px;
}

h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; display: flex; align-items: baseline; gap: 10px; }
#count { color: var(--accent); font-weight: 700; }
#count:empty { display: none; }
.head-right { display: flex; align-items: center; gap: 12px; }
#who { color: var(--muted); font-size: 0.85rem; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
#theme { font-size: 1.4rem; line-height: 1; width: 36px; height: 36px; border: 1.5px solid var(--fg); border-radius: 50%; display: grid; place-items: center; }

main { padding-bottom: 40px; }

#add-form { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--fg); }
#add-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1.1rem;
  padding: 14px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
}
#add-form input::placeholder { color: var(--muted); }
#add-form button { font-size: 1.8rem; line-height: 1; padding: 0 4px; }

#items { list-style: none; margin: 0; padding: 0; }
#items li { display: flex; align-items: center; gap: 14px; padding: 4px 0; border-bottom: 1px solid var(--line); }
#items .check {
  flex: none;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--fg);
  border-radius: 50%;
  color: var(--bg);
  font-size: 0.9rem;
  display: grid;
  place-items: center;
}
#items li.done .check { background: var(--fg); }
#items .name { flex: 1; padding: 14px 0; overflow-wrap: anywhere; }
#items li.done .name { color: var(--muted); text-decoration: line-through; }
#items .by { color: var(--muted); font-size: 0.78rem; margin-left: 6px; }
#items .del { color: var(--muted); font-size: 1rem; padding: 12px 4px; }

#empty { color: var(--muted); padding: 28px 0; }

button.secondary { display: block; margin: 24px auto 0; color: var(--muted); font-size: 0.9rem; border-bottom: 1px solid var(--line); padding-bottom: 2px; }

#home-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
  font-size: 0.95rem;
}
#home-banner button { color: var(--accent); font-weight: 700; }

#login { text-align: center; padding: 56px 0; color: var(--muted); }
#login button { margin-top: 16px; padding: 10px 18px; border: 1.5px solid var(--fg); border-radius: 999px; color: var(--fg); }
#status { color: var(--accent); text-align: center; min-height: 1.4em; font-size: 0.9rem; }
[hidden] { display: none !important; }
