/* Notes tool. Shared colours, header and buttons come from /assets/site.css. */
.notes { --panel: #131e45; --line: #24315f; --paper: #0e1838; --paper-ink: #f4f6fb; }
.notes.light { --paper: #fffdf7; --paper-ink: #1b1b1b; }

.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.list { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.list-head .btn { width: 100%; }
#noteList { list-style: none; margin: 10px 0 0; padding: 0; max-height: 420px; overflow-y: auto; }
@media (max-width: 760px) { #noteList { max-height: 160px; } }
#noteList li button {
  display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px;
  color: var(--ink); font: inherit; font-size: 14px; padding: 8px 10px; cursor: pointer;
}
#noteList li button:hover { background: rgba(255, 255, 255, 0.06); }
#noteList li.active button { background: rgba(245, 184, 46, 0.16); outline: 1px solid rgba(245, 184, 46, 0.5); }
#noteList .t { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#noteList .d { display: block; font-size: 12px; color: var(--muted); }

.editor-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); align-items: center; }
.group { display: flex; gap: 4px; align-items: center; }
.tb-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.tb {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 6px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--ink); font: 15px/1 system-ui, sans-serif;
}
.tb:hover { border-color: var(--accent); }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); cursor: pointer; padding: 0; }
.sw.c-red { background: #e5534b; } .sw.c-orange { background: #e7832a; } .sw.c-green { background: #2ea44f; }
.sw.c-blue { background: #3b82f6; } .sw.c-purple { background: #9b59d0; }
.sw.hl-yellow { background: #fde68a; } .sw.hl-green { background: #bbf7d0; } .sw.hl-pink { background: #fbcfe8; }
.sw.none { background: transparent; color: var(--muted); font-size: 12px; line-height: 1; }
.sw:hover { border-color: var(--accent); }

.editor {
  min-height: 50vh; padding: 16px 18px; outline: none;
  background: var(--paper); color: var(--paper-ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: anywhere;
}
.editor:empty::before { content: "Start typing…"; color: var(--muted); }
.editor h2 { font-size: 22px; margin: 14px 0 6px; }
.editor h3 { font-size: 18px; margin: 12px 0 4px; }
.editor p, .editor div { margin: 0 0 6px; }
.editor ul, .editor ol { margin: 4px 0 8px; padding-left: 24px; }

/* text colours and highlights (classes, so they work with the site's security policy) */
.editor .c-red { color: #e5534b; } .editor .c-orange { color: #e7832a; } .editor .c-green { color: #2ea44f; }
.editor .c-blue { color: #4a8ff5; } .editor .c-purple { color: #a66ad8; }
.editor mark { color: #1b1b1b; border-radius: 3px; padding: 0 2px; }
.editor mark.hl-yellow { background: #fde68a; } .editor mark.hl-green { background: #bbf7d0; } .editor mark.hl-pink { background: #fbcfe8; }

/* checklists: tap the box to tick */
.editor ul.check { list-style: none; padding-left: 4px; }
.editor ul.check li { position: relative; padding-left: 28px; }
.editor ul.check li::before {
  content: ""; position: absolute; left: 2px; top: 0.3em; width: 16px; height: 16px;
  border: 2px solid currentColor; border-radius: 4px; opacity: 0.7; cursor: pointer;
}
.editor ul.check li.done { text-decoration: line-through; opacity: 0.6; }
.editor ul.check li.done::before { content: "✓"; font-size: 13px; line-height: 16px; text-align: center; opacity: 1; background: #2ea44f; border-color: #2ea44f; color: #fff; }

.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.bar .spacer { flex: 1; }
.btn.small { font-size: 13px; padding: 5px 10px; }
.btn.danger:hover { border-color: #e5534b; color: #e5534b; }
.note { font-size: 13px; color: var(--muted); margin-top: 18px; max-width: 90ch; }
