/* Minimal palette: off-white, dark gray, single accent. */
:root {
  --bg: #faf9f7;
  --fg: #2b2b2b;
  --muted: #888;
  --line: #e6e3de;
  --accent: #6b8e7f;
  --accent-hover: #557566;
  --error: #b14242;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button {
  font: inherit;
  cursor: pointer;
}

/* Login page */
body.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card {
  width: min(360px, 92vw);
  padding: 2rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.card h1 {
  margin: 0 0 1.25rem 0;
  font-size: 1.25rem;
  font-weight: 500;
}
.card label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.card input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: inherit;
  background: var(--bg);
}
.card input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
}
.card button {
  margin-top: 1rem;
  width: 100%;
  padding: 0.6rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 3px;
}
.card button:hover { background: var(--accent-hover); }

/* User page */
body.user main {
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}
.topbar {
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.topbar > span {
  font-size: 1.05rem;
  color: var(--fg);
}
.topbar form { margin: 0; }
button.link {
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  padding: 0;
  font-size: 0.9rem;
}
button.link:hover { color: var(--fg); }

.intro p {
  color: var(--fg);
  margin: 0 0 1.5rem 0;
}
.intro p:first-child { margin-top: 1rem; }
.intro p:last-child { margin-bottom: 2rem; }

.add form { display: flex; flex-direction: column; gap: 0.5rem; }
.add label {
  font-size: 0.85rem;
  color: var(--muted);
}
.add input[type="text"] {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: inherit;
  font-size: 0.9rem;
  background: white;
}
.add input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.add button {
  align-self: flex-start;
  padding: 0.55rem 1.2rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 3px;
  margin-top: 0.25rem;
}
.add button:hover { background: var(--accent-hover); }

.muted { color: var(--muted); }
.error { color: var(--error); font-size: 0.9rem; margin: 0; }

/* Brief floating confirmation after a successful add. Pure CSS:
   fade in → hold → fade out → element is left non-interactive.
   Total: ~1.5s. Forwards keeps the final (transparent) state so the
   toast doesn't reappear at the end of the keyframes. */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  pointer-events: none;
  opacity: 0;
  animation: toast 1.5s ease forwards;
}
@keyframes toast {
  0%   { opacity: 0; transform: translate(-50%, 6px); }
  20%  { opacity: 1; transform: translate(-50%, 0); }
  75%  { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -4px); }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation: toast-fade 1.5s ease forwards; }
  @keyframes toast-fade {
    0%, 80% { opacity: 1; }
    100%    { opacity: 0; }
  }
}
