:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --text: #1f2a24;
  --muted: #6b7069;
  --accent: #c8553d;
  --accent-text: #ffffff;
  --border: #e2ddd2;
  --radius: 12px;
  font-family: ui-rounded, system-ui, -apple-system, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161b18;
    --surface: #1f2622;
    --text: #ece8de;
    --muted: #9aa097;
    --accent: #e0745c;
    --border: #2f3832;
  }
}

* {
  box-sizing: border-box;
}

/* `hidden` wins over a class's display (e.g. the new-list form's flex). */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(0.75rem + env(safe-area-inset-top)) 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  font-size: 1.1rem;
  margin: 0;
}

.topbar nav {
  display: flex;
  gap: 0.25rem;
}

.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
}

.topbar nav a[aria-current="page"] {
  background: var(--text);
  color: var(--bg);
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
}

.muted {
  color: var(--muted);
}

button {
  font: inherit;
  border: none;
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
}

button.primary {
  background: var(--accent);
  color: var(--accent-text);
  font-size: 1.15rem;
  width: 100%;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

input {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
}
