:root {
  color-scheme: light dark;
  --bg: #fbf8f9; --panel: #ffffff; --text: #2b2227; --muted: #7a6d74; --line: #eadfe4; --accent: #9b3f6b;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1d181b; --panel: #262024; --text: #f1e9ed; --muted: #a8999f; --line: #3a3036; --accent: #e08bb2; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.status { margin-left: auto; color: var(--muted); font-size: 13px; }
.notice { margin: 12px 16px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 13px; color: var(--muted); }
.notice p { margin: 0 0 4px; color: var(--text); }
.notice ul { margin: 0; padding-left: 18px; }
.signed-out { max-width: 520px; margin: 64px auto; padding: 0 16px; text-align: center; }
.columns { flex: 1; display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 12px; padding: 12px 16px 16px; min-height: 0; }
.list { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.list-actions { display: flex; gap: 8px; }
#new-note { flex: none; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
#search { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; }
#notes { list-style: none; margin: 0; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.row { display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; cursor: pointer; }
.row:hover, .row.selected { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.row .title { font-weight: 600; }
.row .excerpt { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .meta { color: var(--muted); font-size: 12px; }
.note { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 12px; min-height: 60vh; }
.note textarea { flex: 1; width: 100%; min-height: 50vh; resize: none; border: 0; background: none; color: var(--text); font: 15px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; outline: none; }
.actions { display: flex; align-items: center; gap: 10px; }
.actions button { padding: 6px 16px; border-radius: 8px; border: 0; background: var(--accent); color: white; font: inherit; cursor: pointer; }
.actions button:disabled { opacity: 0.45; cursor: default; }
.message, .attachments, .empty { color: var(--muted); font-size: 13px; margin: 0; }
.empty { padding: 12px; }
@media (max-width: 720px) { .columns { grid-template-columns: 1fr; } .note { min-height: 50vh; } }
