:root {
  --bg: #0b0b0c;
  --surface: #111113;
  --raised: #17171a;
  --hover: #1c1c20;
  --line: #232327;
  --line-strong: #313137;
  --text: #ecebe7;
  --dim: #a3a29d;
  --faint: #6a6965;
  --accent: #ff6a3d;
  --accent-ink: #1a0b05;
  --accent-soft: rgba(255, 106, 61, 0.12);
  --ok: #7cc49f;
  --danger: #ff5a52;

  --c-rules: #ff6a3d;
  --c-style: #e7b04b;
  --c-code: #7cc49f;
  --c-design: #8ea7ff;
  --c-monetization: #d58bd2;
  --c-platform: #69c1d3;
  --c-workflow: #b8b38a;
  --c-game: #ef8b84;
  --c-team: #9d9d9d;

  --l-red: #e5534b;
  --l-orange: #ec8a3a;
  --l-yellow: #d9b43c;
  --l-green: #57ab5a;
  --l-blue: #4f8ff7;
  --l-purple: #a371f7;
  --l-gray: #768390;

  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;

  --radius: 6px;
  --side: 232px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #26262b; border: 3px solid var(--bg); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.eyebrow {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.shell { display: grid; grid-template-columns: var(--side) 1fr; height: 100vh; }

.side {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 20px 20px 18px;
  text-decoration: none;
}
.brand-mark { font: 400 26px/1 var(--serif); letter-spacing: -0.01em; }
.brand-mark i { color: var(--accent); font-style: italic; }
.brand-sub { font: 500 10px/1 var(--mono); color: var(--faint); letter-spacing: 0.1em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; padding: 4px 10px; gap: 1px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 5px;
  text-decoration: none;
  color: var(--dim);
  font-weight: 450;
}
.nav a svg { width: 15px; height: 15px; flex: none; opacity: 0.8; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.on { background: var(--raised); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav .count { margin-left: auto; font: 11px var(--mono); color: var(--faint); }

.side-section { padding: 18px 20px 6px; }
.cats { display: flex; flex-direction: column; padding: 0 10px; gap: 1px; overflow: auto; }
.cats a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-radius: 5px;
  text-decoration: none;
  color: var(--dim);
  font-size: 13px;
}
.cats a:hover { background: var(--surface); color: var(--text); }
.cats a.on { color: var(--text); background: var(--surface); }
.cats .count { margin-left: auto; font: 11px var(--mono); color: var(--faint); }
.dot { width: 7px; height: 7px; border-radius: 2px; flex: none; background: var(--faint); }

.side-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font: 600 11px var(--mono);
  color: var(--dim);
  overflow: hidden;
  flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who { min-width: 0; line-height: 1.25; }
.who b { display: block; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { font: 11px var(--mono); color: var(--faint); }
.live {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}
.live.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(124, 196, 159, 0.15); }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar {
  height: 52px;
  flex: none;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
}
.topbar h1 { margin: 0; font: 500 14px var(--sans); }
.topbar .crumb { font: 12px var(--mono); color: var(--faint); }
.topbar .spacer { flex: 1; }
.view { flex: 1; min-height: 0; overflow: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--hover); border-color: #3c3c43; }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #ff7d55; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { background: var(--surface); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: default; }

.input, .textarea, .select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.12s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.textarea.code { font: 13px/1.6 var(--mono); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font: 500 11px var(--mono); color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase; }
.field .hint { font-size: 12px; color: var(--faint); }

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search svg { position: absolute; left: 10px; width: 14px; height: 14px; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 32px; padding-right: 34px; height: 34px; background: var(--surface); border-color: var(--line); }
.search kbd {
  position: absolute;
  right: 8px;
  font: 11px var(--mono);
  color: var(--faint);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 5px;
}

.notes-layout { display: grid; grid-template-columns: 340px 1fr; height: 100%; }
.note-list-pane { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.note-list-head { padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 10px; }
.note-list-head .row { display: flex; align-items: center; justify-content: space-between; }
.note-list { overflow: auto; flex: 1; padding: 0 8px 24px; }
.group-label { display: flex; align-items: center; gap: 8px; padding: 16px 8px 6px; }
.note-row {
  display: block;
  padding: 9px 10px 10px;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid transparent;
}
.note-row:hover { background: var(--surface); }
.note-row.on { background: var(--raised); border-color: var(--line); }
.note-row .t { display: flex; align-items: center; gap: 7px; font-weight: 500; font-size: 13.5px; }
.note-row .t .star { color: var(--accent); font-size: 11px; }
.note-row .s {
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.45;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-row .m { margin-top: 6px; font: 11px var(--mono); color: var(--faint); display: flex; gap: 10px; }
.note-row mark { background: var(--accent-soft); color: var(--text); border-radius: 2px; padding: 0 1px; }

.reader { overflow: auto; height: 100%; }
.reader-inner { max-width: 760px; margin: 0 auto; padding: 44px 48px 120px; }
.reader .path { font: 12px var(--mono); color: var(--faint); display: flex; align-items: center; gap: 8px; }
.reader .path a { text-decoration: none; }
.reader .path a:hover { color: var(--text); }
.reader h1.title {
  font: 400 44px/1.05 var(--serif);
  letter-spacing: -0.015em;
  margin: 14px 0 14px;
}
.reader .lead { font-size: 17px; line-height: 1.55; color: var(--dim); margin: 0 0 18px; max-width: 64ch; }
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font: 12px var(--mono);
  color: var(--faint);
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.meta-row b { color: var(--dim); font-weight: 500; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 11px var(--mono);
  color: var(--dim);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 8px;
  text-decoration: none;
}
.pill.core { border-color: rgba(255, 106, 61, 0.5); color: var(--accent); }
.reader-actions { display: flex; gap: 6px; margin-left: auto; }

.md { font-size: 15px; line-height: 1.7; color: #dedcd7; margin-top: 26px; }
.md > *:first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; color: var(--text); margin: 1.8em 0 0.6em; }
.md h1 { font-size: 22px; }
.md h2 { font-size: 18px; }
.md h3 { font-size: 15.5px; }
.md p { margin: 0 0 1em; }
.md strong { color: var(--text); font-weight: 600; }
.md a { color: var(--text); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.md a:hover { text-decoration-color: var(--accent); }
.md a.wikilink { color: var(--accent); text-decoration: none; border-bottom: 1px dashed rgba(255, 106, 61, 0.45); }
.md a.wikilink.missing { color: var(--faint); border-bottom-color: var(--line-strong); }
.md code { font: 13px var(--mono); background: var(--raised); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.md pre { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; overflow: auto; }
.md pre code { background: none; border: 0; padding: 0; font-size: 12.5px; line-height: 1.6; }
.md ul, .md ol { padding-left: 1.3em; margin: 0 0 1em; }
.md li { margin: 0.25em 0; }
.md li::marker { color: var(--faint); }
.md blockquote { margin: 0 0 1em; padding: 2px 0 2px 16px; border-left: 2px solid var(--accent); color: var(--dim); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.md table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: 13.5px; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.md th { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.md img { max-width: 100%; border-radius: 6px; }

.related { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.related ul { list-style: none; margin: 10px 0 0; padding: 0; }
.related li a {
  display: block;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--dim);
  font-size: 13.5px;
}
.related li a:hover { color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; }

.overview { max-width: 900px; margin: 0 auto; padding: 48px 48px 100px; }
.overview h2 { font: 400 40px/1.05 var(--serif); margin: 10px 0 8px; letter-spacing: -0.01em; }
.overview p.intro { color: var(--dim); max-width: 60ch; margin: 0 0 34px; font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stat { padding: 18px 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .n { font: 400 38px/1 var(--serif); }
.stat .l { margin-top: 8px; }
.split-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin: 28px 0 10px; background: var(--surface); }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 11.5px var(--mono); color: var(--dim); }
.split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 44px 0 12px; }

.feed { list-style: none; padding: 0; margin: 0; }
.feed li {
  display: grid;
  grid-template-columns: 62px 28px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.feed .time { font: 11.5px/26px var(--mono); color: var(--faint); }
.feed .line { line-height: 1.5; padding-top: 3px; min-width: 0; }
.feed .line a { text-decoration: none; font-weight: 500; }
.feed .line a:hover { color: var(--accent); }
.feed .agent { font: 11px var(--mono); color: var(--faint); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 5px; margin-left: 4px; white-space: nowrap; }
.feed .detail { display: block; color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.verb-created { color: var(--ok); }
.verb-updated { color: var(--c-design); }
.verb-deleted, .verb-purged, .verb-removed { color: var(--danger); }
.verb-restored, .verb-added { color: var(--c-style); }
.day-head { margin: 34px 0 4px; }
.day-head:first-child { margin-top: 0; }

.page { max-width: 920px; margin: 0 auto; padding: 40px 48px 100px; }
.page-head h2 { font: 400 38px/1.05 var(--serif); margin: 10px 0 8px; letter-spacing: -0.01em; }
.page-head p { color: var(--dim); max-width: 64ch; margin: 0 0 30px; }

.trash-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.trash-row .t { font-weight: 500; }
.trash-row .reason { margin-top: 6px; color: var(--dim); font-size: 13px; }
.trash-row .reason::before { content: '“'; color: var(--faint); }
.trash-row .reason::after { content: '”'; color: var(--faint); }
.trash-row .m { margin-top: 6px; font: 11.5px var(--mono); color: var(--faint); }
.trash-row .acts { display: flex; gap: 6px; align-items: start; }

.empty { padding: 60px 20px; text-align: center; color: var(--faint); }
.empty .big { font: 400 26px var(--serif); color: var(--dim); margin-bottom: 6px; }

.editor { max-width: 1200px; margin: 0 auto; padding: 28px 36px 80px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor-grid .full { grid-column: 1 / -1; }
.editor .title-input {
  font: 400 34px/1.15 var(--serif);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 6px 0 10px;
}
.editor .title-input:focus { border-color: var(--accent); }
.body-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-height: 420px; }
.body-split .textarea { min-height: 420px; height: 100%; }
.body-split .preview { border: 1px solid var(--line); border-radius: 5px; padding: 14px 18px; overflow: auto; max-height: 640px; }
.body-split .preview .md { margin-top: 0; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; color: var(--dim); font-size: 12.5px; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--raised); color: var(--text); }
.editor-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.editor-foot .spacer { flex: 1; }

.board-wrap { display: flex; flex-direction: column; height: 100%; }
.board-tabs { display: flex; align-items: center; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); height: 44px; flex: none; overflow-x: auto; }
.board-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px;
  text-decoration: none;
  color: var(--dim);
  font-size: 13px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.board-tabs a:hover { color: var(--text); }
.board-tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.board-tabs .main-tag { font: 10px var(--mono); color: var(--faint); letter-spacing: 0.08em; text-transform: uppercase; }
.board-tabs .spacer { flex: 1; }
.board {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 24px;
  overflow-x: auto;
}
.list {
  width: 288px;
  flex: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}
.list.dragging { opacity: 0.4; }
.list-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px 14px; cursor: grab; }
.list-head .name { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; border-radius: 4px; padding: 2px 4px; margin-left: -4px; }
.list-head .name[contenteditable='true'] { outline: 1px solid var(--accent); cursor: text; }
.list-head .n { font: 11px var(--mono); color: var(--faint); }
.cards { display: flex; flex-direction: column; gap: 6px; padding: 2px 8px 8px; overflow-y: auto; min-height: 12px; }
.card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.1s;
}
.card:hover { border-color: var(--line-strong); }
.card.dragging { opacity: 0.35; }
.card .cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--bg); border-bottom: 1px solid var(--line); }
.card .body { padding: 9px 11px 10px; }
.card .labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.label-chip { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 3px; font: 500 10.5px var(--sans); color: #0b0b0c; }
.label-chip.bare { width: 30px; height: 6px; padding: 0; }
.card .ct { font-size: 13.5px; line-height: 1.4; word-break: break-word; }
.card .badges { display: flex; gap: 10px; margin-top: 7px; font: 11px var(--mono); color: var(--faint); }
.card .badges span { display: inline-flex; align-items: center; gap: 4px; }
.card .badges svg { width: 12px; height: 12px; }
.drop-marker { height: 3px; border-radius: 2px; background: var(--accent); margin: -1px 0; }
.add-card { margin: 0 8px 8px; }
.add-card .btn { width: 100%; justify-content: flex-start; }
.add-card textarea { min-height: 60px; }
.add-card .row { display: flex; gap: 6px; margin-top: 6px; }
.new-list { width: 288px; flex: none; }
.new-list .btn { width: 100%; height: 40px; justify-content: flex-start; border-style: dashed; background: transparent; color: var(--dim); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 6, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 7vh 20px 40px;
  overflow: auto;
  z-index: 50;
  animation: fade 0.12s ease-out;
}
.modal {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: rise 0.16s ease-out;
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 0; }
.modal-head h3 { margin: 0; font: 400 26px/1.15 var(--serif); flex: 1; }
.modal-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.x-btn { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 4px; border-radius: 4px; }
.x-btn:hover { color: var(--text); background: var(--hover); }
.x-btn svg { width: 16px; height: 16px; display: block; }

.card-modal .card-title {
  font: 400 26px/1.2 var(--serif);
  background: transparent;
  border: 0;
  padding: 0;
  width: 100%;
  outline: none;
  resize: none;
  overflow: hidden;
}
.card-modal .in-list { font: 12px var(--mono); color: var(--faint); margin-top: 4px; }
.label-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.label-picker button {
  height: 26px;
  min-width: 40px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  font: 500 11px var(--sans);
  color: #0b0b0c;
  padding: 0 8px;
  opacity: 0.4;
}
.label-picker button.on { opacity: 1; border-color: var(--text); }
.desc-view { min-height: 40px; cursor: text; border-radius: 5px; padding: 2px 0; }
.desc-view .md { margin-top: 0; font-size: 14px; }
.desc-view.empty-desc { color: var(--faint); border: 1px dashed var(--line-strong); padding: 12px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gallery figure { margin: 0; position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; cursor: zoom-in; }
.gallery figure .x-btn { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, 0.6); color: #fff; opacity: 0; }
.gallery figure:hover .x-btn { opacity: 1; }
.dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
  cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, 0.9); display: grid; place-items: center; cursor: zoom-out; padding: 30px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }

.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast {
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--accent);
  border-radius: 6px;
  padding: 10px 14px;
  min-width: 240px;
  max-width: 380px;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  animation: rise 0.16s ease-out;
  display: flex;
  gap: 12px;
  align-items: center;
}
.toast.err { border-left-color: var(--danger); }
.toast .btn { margin-left: auto; }

.setup-step { display: grid; grid-template-columns: 56px 1fr; gap: 6px 18px; padding: 28px 0; border-top: 1px solid var(--line); }
.setup-step .num { font: 400 34px/1 var(--serif); color: var(--accent); }
.setup-step h3 { margin: 2px 0 6px; font-size: 16px; font-weight: 600; }
.setup-step p { margin: 0 0 14px; color: var(--dim); }
.token-box { display: flex; gap: 8px; }
.token-box .input { font-family: var(--mono); font-size: 12.5px; }
.codeblock { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin: 0 0 10px; }
.codeblock pre { margin: 0; padding: 14px 120px 14px 16px; overflow: auto; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; color: #d8d6d0; }
.codeblock.tall pre { max-height: 420px; }
.codeblock .btn { position: absolute; top: 8px; right: 8px; }
.tabs-mini { display: flex; gap: 4px; margin-bottom: 10px; }
.tabs-mini button { border: 1px solid var(--line); background: transparent; color: var(--dim); border-radius: 5px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.tabs-mini button.on { color: var(--text); border-color: var(--line-strong); background: var(--raised); }
.callout { border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: 6px; padding: 12px 14px; color: var(--dim); font-size: 13px; background: var(--surface); }
.callout b { color: var(--text); font-weight: 600; }

.table { width: 100%; border-collapse: collapse; }
.table td, .table th { padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font: 500 10.5px var(--mono); color: var(--faint); letter-spacing: 0.1em; text-transform: uppercase; padding-bottom: 8px; }
.table td.r, .table th.r { text-align: right; }
.member { display: flex; align-items: center; gap: 12px; }
.member b { font-weight: 500; display: block; }
.member span { font: 12px var(--mono); color: var(--faint); }

.graph-wrap { position: relative; height: 100%; overflow: hidden; }
.graph-wrap canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.graph-wrap canvas.dragging { cursor: grabbing; }
.graph-legend { position: absolute; left: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 5px; font: 11.5px var(--mono); color: var(--dim); background: rgba(11, 11, 12, 0.8); padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; }
.graph-legend span { display: flex; align-items: center; gap: 8px; }
.graph-hint { position: absolute; right: 18px; bottom: 18px; font: 11px var(--mono); color: var(--faint); }

.history-item { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.history-item .v { font: 400 22px/1 var(--serif); color: var(--accent); width: 34px; }
.history-item .info { flex: 1; min-width: 0; }
.history-item .info .m { font: 11.5px var(--mono); color: var(--faint); margin-top: 3px; }
.history-item details { margin-top: 8px; }
.history-item summary { cursor: pointer; font-size: 12px; color: var(--dim); }
.history-item pre { white-space: pre-wrap; font: 12px/1.55 var(--mono); color: var(--dim); max-height: 240px; overflow: auto; background: var(--bg); padding: 10px; border-radius: 4px; }

.menu-btn { display: none; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1100px) {
  .notes-layout { grid-template-columns: 290px 1fr; }
  .reader-inner, .overview, .page { padding-left: 28px; padding-right: 28px; }
}

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform 0.18s; }
  .shell.menu-open .side { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6); }
  .menu-btn, .menu-back { display: inline-flex !important; }
  .topbar { padding: 0 12px; }
  .notes-layout { grid-template-columns: 1fr; }
  .notes-layout.reading .note-list-pane { display: none; }
  .notes-layout:not(.reading) .reader { display: none; }
  .reader-inner, .overview, .page, .editor { padding: 26px 16px 80px; }
  .reader h1.title { font-size: 34px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .related, .editor-grid, .body-split { grid-template-columns: 1fr; }
  .feed li { grid-template-columns: 48px 1fr auto; }
  .feed li .avatar { display: none; }
  .setup-step { grid-template-columns: 1fr; }
}

.board-wrap { background: var(--bg); }
.board-wrap.has-bg { background: linear-gradient(rgba(8, 8, 9, 0.28), rgba(8, 8, 9, 0.5)), var(--board-bg) center / cover no-repeat; }
.board-wrap.has-bg .board-tabs { background: rgba(11, 11, 12, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.board-wrap.has-bg .list { background: rgba(17, 17, 19, 0.84); border-color: rgba(255, 255, 255, 0.08); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.board-wrap.has-bg .new-list .btn { background: rgba(11, 11, 12, 0.55); color: var(--text); border-color: rgba(255, 255, 255, 0.28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.bg-preview { aspect-ratio: 16 / 9; border-radius: 8px; border: 1px solid var(--line); background: var(--bg) center / cover no-repeat; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--faint); font-size: 13px; }

.card { flex-shrink: 0; }
.ct-row { display: flex; align-items: flex-start; }
.card-check {
  flex: none;
  width: 0;
  height: 18px;
  margin-top: 1px;
  padding: 0;
  border: 1.5px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  transition: width 0.14s ease, margin 0.14s ease, opacity 0.14s ease, background 0.12s, border-color 0.12s;
}
.card-check svg { width: 12px; height: 12px; stroke-width: 2.6; }
.card:hover .card-check, .card-check:focus-visible, .card.done .card-check {
  width: 18px;
  margin-right: 8px;
  opacity: 1;
  border-color: var(--faint);
}
.card:hover .card-check { color: var(--faint); }
.card-check:hover { border-color: var(--ok); color: var(--ok); }
.card.done .card-check { background: var(--ok); border-color: var(--ok); color: #0b0b0c; }
.card.done .ct { color: var(--dim); }
.card.done .card-check:hover { background: transparent; color: var(--ok); }
.done-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 10px;
  padding: 2px 9px 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--dim);
  font: 500 11.5px var(--sans);
  cursor: pointer;
  vertical-align: middle;
}
.done-toggle svg { width: 12px; height: 12px; stroke-width: 2.4; }
.done-toggle:hover { border-color: var(--ok); color: var(--ok); }
.done-toggle.on { background: var(--ok); border-color: var(--ok); color: #0b0b0c; }
