:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #16181d;
  --muted: #6b7280;
  --line: #e3e6ea;
  --accent: #3b5bdb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --card: #1c1f25;
    --text: #e9eaee;
    --muted: #9aa1ac;
    --line: #2b2f37;
    --accent: #748ffc;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem 1rem;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

h1 { font-size: 1.6rem; margin: 0; }

.status { font-size: .8rem; color: var(--muted); }

form {
  display: grid;
  gap: .6rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .7rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

input, textarea, button {
  font: inherit;
  color: inherit;
  border-radius: .5rem;
  border: 1px solid var(--line);
  padding: .6rem .7rem;
  background: var(--bg);
}

textarea { resize: vertical; }

button {
  justify-self: start;
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  cursor: pointer;
  padding: .6rem 1.1rem;
}

button:disabled { opacity: .6; cursor: default; }

ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }

li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .7rem;
  padding: .9rem 1rem;
  display: grid;
  gap: .3rem;
}

li h2 { font-size: 1rem; margin: 0; }

li p { margin: 0; white-space: pre-wrap; }

li footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  color: var(--muted);
}

li footer button {
  background: none;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: .2rem .55rem;
  font-size: .78rem;
}

.empty { color: var(--muted); text-align: center; }
