:root {
  --fg: #1b1d22;
  --bg: #fdfcf8;
  --muted: #6c7078;
  --accent: #3a6df0;
  --error: #c23b3b;
  --ok: #2c8a4a;
  --border: #e3e1da;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; }
.topbar nav { margin-left: auto; display: flex; gap: 0.75rem; align-items: center; }
.topbar .user { color: var(--muted); }

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

.notes-header { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.notes-title-row { display: flex; align-items: center; justify-content: space-between; }
.notes-title-row h1 { margin: 0; }
.sync-btn { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.sync-btn:hover { background: var(--accent); color: white; }
.sync-btn.htmx-request { opacity: 0.6; pointer-events: none; }
.new-note { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem; }
.new-note textarea { grid-column: 1 / -1; }

#note-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.note {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  background: white;
}
.note h3 { margin: 0 0 0.25rem; }
.note p { margin: 0 0 0.5rem; white-space: pre-wrap; }
.note-actions { display: flex; gap: 0.5rem; align-items: center; }
.note-actions .inline-share { display: flex; gap: 0.25rem; margin-left: auto; }

input, textarea, button {
  font: inherit;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
}
button { cursor: pointer; background: var(--accent); color: white; border-color: transparent; }
button:hover { filter: brightness(1.05); }

.toast {
  position: fixed; top: 1rem; right: 1rem;
  padding: 0.6rem 0.9rem;
  background: var(--ok); color: white;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  z-index: 10;
}
.toast-err { background: var(--error); }
.toast-offline { background: #333; }
.error { color: var(--error); }
.dim { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; list-style: none; padding: 1rem 0; }

#offline-banner:empty { display: none; }
#offline-banner .offline {
  padding: 0.5rem 1rem;
  background: #333; color: white;
}
