:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6b6b70;
  --border: #e2e2de;
  --accent: #2f5bd3;
  --accent-text: #ffffff;
  --ok-bg: #e7f5ea;
  --ok-text: #1e6b34;
  --err-bg: #fbeaea;
  --err-text: #a12828;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151517;
    --surface: #1f1f23;
    --text: #ececef;
    --muted: #9a9aa2;
    --border: #2e2e34;
    --accent: #6e8ff0;
    --accent-text: #0e0e10;
    --ok-bg: #173322;
    --ok-text: #8fd9a5;
    --err-bg: #3a1a1a;
    --err-text: #f0a0a0;
  }
}

* { box-sizing: border-box; }

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

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

h1 { font-size: 1.75rem; margin: 0 0 16px; }
h2 { font-size: 1.25rem; margin: 40px 0 12px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  margin-bottom: 24px;
}
.topbar form { margin: 0; }

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }

input, textarea, select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
textarea { resize: vertical; width: 100%; }

.row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}
.row label { flex-direction: row; align-items: center; gap: 8px; }

button {
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-text);
  border: 0;
  border-radius: 6px;
  padding: 8px 20px;
  cursor: pointer;
}
button.link {
  background: none;
  color: var(--accent);
  padding: 0;
  font-weight: 400;
}

.flash { padding: 10px 14px; border-radius: 6px; }
.flash.success { background: var(--ok-bg); color: var(--ok-text); }
.flash.error { background: var(--err-bg); color: var(--err-text); }

.count {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
}

.inbox { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.inbox li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}
.inbox .meta { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; }
.inbox time { color: var(--muted); }
/* pre-wrap keeps the line breaks people typed; overflow-wrap stops long words from overflowing. */
.inbox p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

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