:root {
  color-scheme: light dark;
  --accent: #2e7d32;
  --bg: #ffffff;
  --fg: #1b1f24;
  --muted: #6b7280;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  padding-bottom: 72px;
}

header {
  position: sticky;
  top: 0;
  background: var(--accent);
  color: white;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

header button {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}

main { padding: 12px; }

.note-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}

.note-card h3 { margin: 0 0 6px; font-size: 1rem; }
.note-card .meta { color: var(--muted); font-size: 0.8rem; margin-bottom: 6px; }
.note-card p { margin: 0; font-size: 0.9rem; white-space: pre-wrap; }

.tag {
  display: inline-block;
  background: #eef4ee;
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  margin-right: 6px;
}

form { display: flex; flex-direction: column; gap: 10px; }

label { font-size: 0.85rem; color: var(--muted); }

input, textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
}

textarea { min-height: 140px; resize: vertical; }

.fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  font-size: 1.6rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.hidden { display: none !important; }

.error { color: #b91c1c; font-size: 0.85rem; }

.empty-state { color: var(--muted); text-align: center; margin-top: 40px; }

.note-content {
  font-size: 0.95rem;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.note-content h1, .note-content h2, .note-content h3 {
  font-size: 1.05rem;
  margin: 16px 0 6px;
}

.note-content p { margin: 0 0 10px; }
.note-content ul, .note-content ol { margin: 0 0 10px; padding-left: 22px; }
.note-content a { color: var(--accent); }
.note-content strong { font-weight: 700; }
.note-content img { max-width: 100%; height: auto; }
.note-content table { display: block; overflow-x: auto; max-width: 100%; }
