:root {
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --border: #d2d2d7;
  --warn-bg: #fff4e5;
  --warn-border: #f0c674;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.dashboard-header {
  padding: 3rem 2rem 2rem;
  text-align: center;
}

.dashboard-header h1 {
  margin: 0 0 0.5rem;
  font-size: 2.25rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
  align-items: start;
}

.widget {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.api-key-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

#api-key-input,
#title-input,
#body-input,
.edit-form input,
.edit-form textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 0.5rem;
}

#body-input,
.edit-form textarea {
  min-height: 4rem;
  resize: vertical;
}

#note-form button,
.edit-form button[type="submit"] {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

.notice {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
}

.notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.note {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.note:last-child {
  border-bottom: none;
}

.note-view h3 {
  margin: 0 0 0.25rem;
}

.note-view p {
  margin: 0 0 0.5rem;
  color: var(--muted);
  white-space: pre-wrap;
}

.note-actions {
  display: flex;
  gap: 0.4rem;
}

.note-actions button,
.edit-form .cancel-btn {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.note-actions .delete-btn:hover {
  color: #c0392b;
  border-color: #c0392b;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
}

.dashboard-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
