:root {
  --bg: #f7f7f5; --panel: #ffffff; --text: #1f2328; --muted: #6b7280;
  --line: #e5e7eb; --accent: #2563eb; --accent-text: #ffffff; --danger: #dc2626; --sel: #eef2ff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --panel: #1a1d23; --text: #e6e8eb; --muted: #9aa1ab;
    --line: #2b3038; --accent: #3b82f6; --accent-text: #ffffff; --danger: #ef4444; --sel: #23293a;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.center { display: grid; place-items: center; min-height: 100%; text-align: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 32px; }
.hero { max-width: 360px; margin: 16px; }
.hero h1 { margin: 0 0 8px; }
.btn { display: inline-block; border: 0; border-radius: 8px; padding: 9px 14px; background: var(--accent); color: var(--accent-text); font: inherit; cursor: pointer; text-decoration: none; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.layout { display: grid; grid-template-columns: 280px 1fr; height: calc(100% - 50px); }
.list { border-right: 1px solid var(--line); padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.list input, .editor input, .editor textarea { width: 100%; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
#notes { list-style: none; margin: 0; padding: 0; }
#notes li { padding: 10px; border-radius: 8px; cursor: pointer; }
#notes li.active { background: var(--sel); }
#notes li b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#notes li small { color: var(--muted); }
.editor { padding: 16px; display: flex; flex-direction: column; }
.editor form { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.editor #title { font-size: 20px; font-weight: 600; }
.editor textarea { flex: 1; min-height: 300px; resize: vertical; }
.row { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
}
