* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1c1c1c;
  background: #f7f7f5;
  line-height: 1.5;
}

.hidden { display: none !important; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #e2e2e0;
}
header h1 { font-size: 1.15rem; margin: 0; }

button {
  font: inherit;
  padding: 0.45rem 0.8rem;
  border: 1px solid #cfcfca;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
button:hover { background: #f0f0ee; }
button.danger { border-color: #d9a3a3; color: #a12a2a; }
button.danger:hover { background: #fbeaea; }

input, textarea {
  font: inherit;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #cfcfca;
  border-radius: 6px;
  background: #fff;
}

.muted { color: #777; font-size: 0.9rem; }
.error { color: #a12a2a; min-height: 1.2em; margin: 0.25rem 0 0; }

/* Auth */
#auth-form {
  max-width: 360px;
  margin: 3rem auto;
  background: #fff;
  padding: 1.5rem;
  border: 1px solid #e2e2e0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
#auth-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }

/* App */
#app-view {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  padding: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}
#sidebar { display: flex; flex-direction: column; gap: 0.5rem; }
#new-entry-btn { width: 100%; }

#entry-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
#entry-list li {
  padding: 0.5rem 0.6rem;
  background: #fff;
  border: 1px solid #e2e2e0;
  border-radius: 6px;
  cursor: pointer;
}
#entry-list li:hover { background: #f0f0ee; }
#entry-list li.active { border-color: #8a8a86; background: #eeedea; }
#entry-list li .title { font-weight: 600; display: block; }
#entry-list li .date { font-size: 0.8rem; color: #777; }

#editor {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid #e2e2e0;
  border-radius: 8px;
  padding: 1rem;
}
#entry-body { min-height: 340px; resize: vertical; }

#hint {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #eef4ee;
  border: 1px solid #cfe0cf;
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  font-style: italic;
}
#hint button { border: none; background: transparent; padding: 0 0.2rem; line-height: 1; }
#hint button:hover { background: transparent; color: #a12a2a; }

#editor-tools, #editor-actions { display: flex; align-items: center; gap: 0.5rem; }

@media (max-width: 640px) {
  #app-view { grid-template-columns: 1fr; }
}
