/* Notion-style portfolio — light document UI */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Newsreader:opsz,wght@6..72,400;6..72,500;6..72,600&display=swap');

:root {
  --n-page:        #ffffff;
  --n-sidebar:     #f7f7f5;
  --n-hover:       #f1f1ef;
  --n-row-hover:   #f7f7f5;
  --n-border:      #ebeae6;
  --n-border-soft: #eeeeec;
  --n-text:        #37352f;
  --n-text-sec:    rgba(55,53,47,0.65);
  --n-text-ter:    rgba(55,53,47,0.45);
  --n-text-faint:  rgba(55,53,47,0.28);
  --n-blue:        #2383e2;
  --n-blue-bg:     #e7f3f8;
  --n-yellow-bg:   #fdecc8;
  --n-yellow-tx:   #ad6914;
  --n-green-bg:    #dbeddb;
  --n-green-tx:    #4d6461;
  --n-pink-bg:     #fadee9;
  --n-pink-tx:     #ad1a72;
  --n-purple-bg:   #ebe5f1;
  --n-purple-tx:   #6940a5;
  --n-gray-bg:     #ebeced;
  --n-gray-tx:     #5a5a58;
  --n-orange-bg:   #faebdd;
  --n-orange-tx:   #b15715;
  --n-red-bg:      #ffe2dd;
  --n-red-tx:      #b13415;
  --n-callout-bg:  #f7f6f3;
  --n-code-bg:     #f7f6f3;
  --n-code-inline: rgba(135,131,120,0.15);
  --n-code-tx:     #eb5757;
  --sidebar-w:     260px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'DM Sans', -apple-system, system-ui, sans-serif;
  color: var(--n-text);
  background: var(--n-page);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.003em;
  font-feature-settings: "ss01", "cv11";
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }

/* ─────────────── App shell ─────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  min-height: 100vh;
}

.app.sidebar-collapsed { grid-template-columns: 0 1fr; }
.app.sidebar-collapsed .sidebar { transform: translateX(-100%); }

/* ─────────────── Sidebar ─────────────── */
.sidebar {
  background: var(--n-sidebar);
  border-right: 1px solid var(--n-border);
  display: flex;
  flex-direction: column;
  font-size: 14px;
  transition: transform 220ms cubic-bezier(0.16,1,0.3,1);
  overflow: hidden;
}

.workspace {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 0;
  cursor: pointer;
  position: relative;
}
.workspace:hover { background: var(--n-hover); }
.workspace .avatar {
  width: 22px; height: 22px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ffd29b, #f5a25d);
  color: white;
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  flex-shrink: 0;
}
.workspace .ws-name {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace .ws-arrow {
  color: var(--n-text-ter);
  font-size: 12px;
  opacity: 0;
  transition: opacity 120ms;
}
.workspace:hover .ws-arrow { opacity: 1; }
.workspace .ws-edit {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 4px;
  color: var(--n-text-sec);
  opacity: 0;
}
.workspace:hover .ws-edit { opacity: 1; }
.workspace .ws-edit:hover { background: rgba(0,0,0,0.06); }

.sb-section {
  padding: 4px 6px;
}
.sb-section + .sb-section { margin-top: 14px; }

.sb-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--n-text);
  min-height: 28px;
  position: relative;
  font-size: 14px;
}
.sb-row:hover { background: var(--n-hover); }
.sb-row .icon {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: var(--n-text-sec);
}
.sb-row .label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.sb-row .badge {
  font-size: 11px;
  color: var(--n-text-ter);
  background: rgba(0,0,0,0.04);
  padding: 1px 5px;
  border-radius: 3px;
}

.sb-section-label {
  padding: 6px 10px 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--n-text-ter);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sb-section-label .plus {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 3px;
  opacity: 0;
  cursor: pointer;
  color: var(--n-text-sec);
}
.sb-section-label:hover .plus { opacity: 1; }
.sb-section-label .plus:hover { background: rgba(0,0,0,0.06); }

.page-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  min-height: 28px;
  font-size: 14px;
  user-select: none;
}
.page-row:hover { background: var(--n-hover); }
.page-row.active { background: rgba(35,131,226,0.10); }
.page-row.active .page-label { font-weight: 600; }
.page-row .twist {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 3px;
  color: var(--n-text-ter);
  font-size: 9px;
  transition: transform 120ms;
  visibility: hidden;
}
.page-row.expandable .twist { visibility: visible; }
.page-row .twist:hover { background: rgba(0,0,0,0.06); color: var(--n-text); }
.page-row.expanded .twist { transform: rotate(90deg); }
.page-row .page-icon {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}
.page-row .page-label {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 2px;
}
.page-row .actions {
  display: flex;
  gap: 1px;
  opacity: 0;
}
.page-row:hover .actions { opacity: 1; }
.page-row .actions button {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 3px;
  color: var(--n-text-sec);
}
.page-row .actions button:hover { background: rgba(0,0,0,0.08); }

.sb-children {
  margin-left: 14px;
  border-left: 1px solid rgba(0,0,0,0.06);
  padding-left: 4px;
  display: flex;
  flex-direction: column;
}
.sb-children .empty {
  padding: 4px 8px;
  color: var(--n-text-ter);
  font-size: 13px;
  font-style: italic;
}

.sb-bottom {
  margin-top: auto;
  padding: 6px;
  border-top: 1px solid transparent;
}

/* ─────────────── Main ─────────────── */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--n-page);
  position: relative;
}

.topbar {
  height: 45px;
  border-bottom: 1px solid transparent;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 4px;
  font-size: 14px;
  flex-shrink: 0;
}

.topbar .menu-toggle {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 4px;
  color: var(--n-text-sec);
  margin-right: 2px;
}
.topbar .menu-toggle:hover { background: var(--n-hover); }

.crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.crumbs .crumb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--n-text-sec);
  cursor: pointer;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumbs .crumb:hover { background: var(--n-hover); }
.crumbs .crumb.current { color: var(--n-text); }
.crumbs .sep { color: var(--n-text-faint); font-size: 12px; }

.topbar .actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.topbar .actions .share-btn {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--n-blue);
}
.topbar .actions .share-btn:hover { background: var(--n-hover); }
.topbar .actions .icon-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 4px;
  color: var(--n-text-sec);
}
.topbar .actions .icon-btn:hover { background: var(--n-hover); }
.topbar .updated {
  font-size: 12px;
  color: var(--n-text-ter);
  padding: 0 6px;
}

/* ─────────────── Page ─────────────── */
.page-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.cover {
  width: 100%;
  height: 30vh;
  min-height: 200px;
  max-height: 320px;
  background-size: cover;
  background-position: center 35%;
  background-color: #d3d3d0;
  position: relative;
}
.cover .cover-actions {
  position: absolute;
  bottom: 12px;
  right: max(24px, calc((100% - 900px) / 2));
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 150ms;
}
.cover:hover .cover-actions { opacity: 1; }
.cover .cover-actions button {
  padding: 4px 8px;
  background: rgba(255,255,255,0.9);
  border-radius: 4px;
  font-size: 13px;
  color: var(--n-text);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.cover .cover-actions button:hover { background: white; }

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 96px 30vh;
  position: relative;
}
.page.has-cover .icon-large { margin-top: -56px; }
.page:not(.has-cover) .icon-large { margin-top: 60px; }

.icon-large {
  font-size: 78px;
  line-height: 1;
  margin-bottom: 14px;
  cursor: pointer;
  display: inline-block;
  padding: 6px;
  margin-left: -10px;
  border-radius: 6px;
  transition: background 120ms;
  position: relative;
  z-index: 2;
}
.icon-large:hover { background: var(--n-hover); }

.page-meta-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--n-text-ter);
  opacity: 0;
  transition: opacity 120ms;
}
.page:hover .page-meta-actions { opacity: 1; }
.page-meta-actions span {
  display: flex; align-items: center; gap: 4px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  margin-left: -6px;
}
.page-meta-actions span:hover { background: var(--n-hover); }

.page-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.018em;
  color: var(--n-text);
  margin: 0 0 6px;
  white-space: pre-wrap;
}
.page-title.serif {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: 48px;
  letter-spacing: -0.012em;
}
.page-title .caret {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--n-text);
  margin-left: 2px;
  vertical-align: -10%;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ─────────────── Blocks ─────────────── */
.blocks { display: flex; flex-direction: column; }

.block {
  position: relative;
  padding: 3px 2px;
  border-radius: 3px;
}
.block-handles {
  position: absolute;
  left: -42px;
  top: 4px;
  display: flex;
  align-items: center;
  gap: 0;
  opacity: 0;
  transition: opacity 100ms;
  height: 24px;
}
.block:hover .block-handles { opacity: 1; }
.block-handles button {
  width: 18px; height: 24px;
  display: grid; place-items: center;
  color: var(--n-text-faint);
  border-radius: 3px;
}
.block-handles button:hover { background: var(--n-hover); color: var(--n-text-sec); }
.block-handles .drag { cursor: grab; font-size: 16px; }

.h1, .h2, .h3 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  color: var(--n-text);
  margin: 0;
  padding: 0;
  line-height: 1.3;
  letter-spacing: -0.012em;
}
.h1 { font-size: 30px; padding: 24px 0 4px; }
.h2 { font-size: 24px; padding: 22px 0 2px; letter-spacing: -0.008em; }
.h3 { font-size: 20px; padding: 18px 0 2px; letter-spacing: -0.006em; }

.paragraph {
  font-size: 16px;
  line-height: 1.5;
  color: var(--n-text);
  padding: 3px 2px;
  margin: 0;
}
.paragraph .muted { color: var(--n-text-sec); }
.paragraph code, .inline-code {
  font-family: 'DM Mono', ui-monospace, monospace;
  background: var(--n-code-inline);
  color: var(--n-code-tx);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.86em;
  line-height: 1.3;
}

.bullet, .number-list {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 2px;
  font-size: 16px;
  line-height: 1.5;
}
.bullet .mark, .number-list .mark {
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  padding-top: 4px;
  font-size: 14px;
  color: var(--n-text);
  line-height: 1.4;
}
.bullet .mark { font-size: 18px; line-height: 1.1; padding-top: 6px; }

.todo {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 2px;
  font-size: 16px;
}
.todo .box {
  width: 16px; height: 16px;
  border: 1px solid var(--n-text-faint);
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 4px;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: white;
}
.todo.done .box {
  background: var(--n-blue);
  border-color: var(--n-blue);
  color: white;
}
.todo .box svg { width: 12px; height: 12px; display: none; }
.todo.done .box svg { display: block; }
.todo.done .label { color: var(--n-text-ter); text-decoration: line-through; }

.divider {
  border: 0;
  border-top: 1px solid var(--n-border);
  margin: 18px 0;
}

.callout {
  display: flex;
  gap: 10px;
  padding: 16px;
  background: var(--n-callout-bg);
  border-radius: 4px;
  margin: 6px 0;
  align-items: flex-start;
}
.callout.blue   { background: var(--n-blue-bg); }
.callout.yellow { background: #fbf3db; }
.callout.green  { background: #ddedea; }
.callout.purple { background: var(--n-purple-bg); }
.callout.pink   { background: var(--n-pink-bg); }
.callout .ico {
  font-size: 18px;
  line-height: 1.6;
  flex-shrink: 0;
}
.callout .body { font-size: 15px; line-height: 1.55; }
.callout .body b { font-weight: 600; }

.toggle {
  padding: 3px 2px;
}
.toggle .toggle-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
}
.toggle .twist {
  width: 24px;
  flex-shrink: 0;
  display: grid; place-items: center;
  padding-top: 5px;
  color: var(--n-text-sec);
  font-size: 11px;
  transition: transform 150ms;
}
.toggle.open .twist { transform: rotate(90deg); }
.toggle .toggle-body {
  margin-left: 26px;
  padding-top: 4px;
  display: none;
  font-size: 15px;
  line-height: 1.55;
  color: var(--n-text);
}
.toggle.open .toggle-body { display: block; }
.toggle .toggle-body p { margin: 0 0 8px; }
.toggle .toggle-body ul { margin: 4px 0 8px; padding-left: 22px; }
.toggle .toggle-body li { margin: 2px 0; }

.quote {
  padding: 4px 14px;
  border-left: 3px solid var(--n-text);
  font-size: 17px;
  line-height: 1.5;
  margin: 6px 0;
}

.code-block {
  background: var(--n-code-bg);
  border-radius: 4px;
  padding: 30px 14px 14px 14px;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--n-text);
  margin: 6px 0;
  position: relative;
  white-space: pre;
  overflow-x: auto;
}
.code-block::before {
  content: attr(data-lang);
  position: absolute;
  top: 8px; left: 14px;
  font-size: 11px;
  color: var(--n-text-ter);
  font-family: 'DM Sans', sans-serif;
  text-transform: lowercase;
}
.code-block .key { color: #c14a4a; }
.code-block .str { color: #2b7a40; }
.code-block .com { color: var(--n-text-ter); font-style: italic; }
.code-block .num { color: #ad6914; }
.code-block .fn  { color: var(--n-blue); }

/* Columns */
.columns {
  display: grid;
  gap: 18px;
  padding: 4px 0;
}
.columns.cols-2 { grid-template-columns: 1fr 1fr; }
.columns.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Properties pseudo-database (the meta block under a title) */
.prop-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 2px 8px;
  font-size: 14px;
  margin: 8px 0 16px;
}
.prop-key {
  display: flex; align-items: center; gap: 6px;
  color: var(--n-text-sec);
  padding: 6px 6px;
  border-radius: 4px;
  cursor: default;
}
.prop-val {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 6px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--n-text);
  min-height: 32px;
  flex-wrap: wrap;
}
.prop-val:hover { background: var(--n-hover); }
.prop-val a { color: var(--n-text); border-bottom: 0.5px solid var(--n-text-faint); }
.prop-val a:hover { border-bottom-color: var(--n-text-sec); }

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 500;
  line-height: 1.5;
  background: var(--n-gray-bg);
  color: var(--n-gray-tx);
}
.tag.blue   { background: var(--n-blue-bg);   color: #1670b3; }
.tag.green  { background: var(--n-green-bg);  color: var(--n-green-tx); }
.tag.yellow { background: #fdecc8;            color: var(--n-yellow-tx); }
.tag.pink   { background: var(--n-pink-bg);   color: var(--n-pink-tx); }
.tag.purple { background: var(--n-purple-bg); color: var(--n-purple-tx); }
.tag.orange { background: var(--n-orange-bg); color: var(--n-orange-tx); }
.tag.red    { background: var(--n-red-bg);    color: var(--n-red-tx); }
.tag.brown  { background: #eee0da;            color: #64473a; }

/* Database — table view */
.db {
  margin: 6px 0;
  font-size: 14px;
}
.db-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0 4px;
  letter-spacing: -0.008em;
}
.db-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--n-border);
  margin-bottom: 4px;
  align-items: center;
}
.db-tab {
  padding: 6px 8px;
  font-size: 14px;
  color: var(--n-text-sec);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}
.db-tab.active { color: var(--n-text); border-bottom-color: var(--n-text); }
.db-tab:hover { background: var(--n-hover); border-radius: 4px 4px 0 0; }
.db-tabs .add-view {
  color: var(--n-text-ter);
  padding: 6px 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; gap: 4px;
}
.db-tabs .add-view:hover { background: var(--n-hover); border-radius: 4px 4px 0 0; }
.db-tabs .right {
  margin-left: auto;
  display: flex; gap: 2px; align-items: center;
}
.db-tabs .right button {
  padding: 4px 8px;
  font-size: 13px;
  color: var(--n-text-sec);
  border-radius: 4px;
}
.db-tabs .right button:hover { background: var(--n-hover); }
.db-tabs .right .new {
  background: var(--n-blue);
  color: white;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px 0 0 4px;
}
.db-tabs .right .new:hover { background: #1d75ce; }
.db-tabs .right .new-drop {
  background: var(--n-blue);
  color: white;
  padding: 4px 6px;
  border-left: 1px solid rgba(255,255,255,0.2);
  border-radius: 0 4px 4px 0;
}
.db-tabs .right .new-drop:hover { background: #1d75ce; }

.db-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.db-table th, .db-table td {
  border: 1px solid var(--n-border);
  padding: 7px 9px;
  text-align: left;
  font-weight: 400;
  vertical-align: middle;
  font-size: 14px;
}
.db-table th {
  color: var(--n-text-sec);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
}
.db-table th .col {
  display: flex; align-items: center; gap: 4px;
}
.db-table tbody tr:hover { background: var(--n-row-hover); }
.db-table .row-title {
  display: flex; align-items: center; gap: 6px;
  color: var(--n-text);
}
.db-table .row-title .pico { font-size: 16px; }
.db-table .row-title a {
  border-bottom: 0.6px solid var(--n-text-faint);
}
.db-table .new-row {
  color: var(--n-text-ter);
  cursor: pointer;
  font-size: 14px;
  padding: 7px 9px;
  border: 1px solid var(--n-border);
  border-top: none;
}
.db-table .new-row:hover { background: var(--n-hover); }
.db-table .tag-cell { display: flex; flex-wrap: wrap; gap: 4px; }
.db-calc {
  padding: 6px 9px;
  font-size: 12px;
  color: var(--n-text-ter);
  border: 1px solid var(--n-border);
  border-top: none;
  display: flex; justify-content: space-between;
}

/* Database — gallery view */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 10px;
  margin: 8px 0;
}
.card {
  border: 1px solid var(--n-border);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: box-shadow 120ms, background 120ms;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card:hover { background: var(--n-row-hover); box-shadow: 0 1px 2px rgba(15,15,15,0.04); }
.card .preview {
  height: 132px;
  background: linear-gradient(135deg, #e7f3f8, #fadee9);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--n-text-ter);
}
.card .preview .gridlines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 14px 14px;
}
.card .preview .glyph {
  position: relative;
  z-index: 1;
  font-family: 'DM Sans', sans-serif;
  font-size: 38px;
  font-weight: 700;
  color: rgba(55,53,47,0.7);
  line-height: 1;
  letter-spacing: -0.02em;
}
.card .preview.green { background: linear-gradient(135deg, #ddedea, #fbf3db); }
.card .preview.purple { background: linear-gradient(135deg, #ebe5f1, #e7f3f8); }
.card .preview.pink { background: linear-gradient(135deg, #fadee9, #faebdd); }
.card .preview.yellow { background: linear-gradient(135deg, #fbf3db, #ddedea); }
.card .body {
  padding: 9px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card .ctitle {
  font-size: 14px;
  font-weight: 600;
  color: var(--n-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.card .ctitle .pico { font-size: 14px; }
.card .csub {
  font-size: 12px;
  color: var(--n-text-sec);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .ctags { display: flex; flex-wrap: wrap; gap: 4px; }
.card .ctags .tag { font-size: 11px; padding: 1px 6px; }

/* Skill clusters */
.skill-cluster {
  border: 1px solid var(--n-border);
  border-radius: 4px;
  padding: 14px 16px;
  background: #fdfdfc;
}
.skill-cluster h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--n-text-sec);
  letter-spacing: 0.01em;
  display: flex; align-items: center; gap: 6px;
}
.skill-cluster .tag-row {
  display: flex; flex-wrap: wrap; gap: 5px;
}

/* Subpage block (inline page link) */
.subpage-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  margin: 2px 0;
}
.subpage-link:hover { background: var(--n-hover); }
.subpage-link .pico { font-size: 18px; flex-shrink: 0; }
.subpage-link .title {
  font-size: 15px;
  font-weight: 500;
  border-bottom: 0.6px solid var(--n-text-faint);
}

/* Comments stub */
.add-comment {
  margin: 14px 0;
  font-size: 14px;
  color: var(--n-text-ter);
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: text;
}
.add-comment:hover { background: var(--n-hover); }
.add-comment .ava {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd29b, #f5a25d);
  color: white;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
}

/* "/" command hint */
.slash-hint {
  font-size: 14px;
  color: var(--n-text-faint);
  padding: 3px 2px;
  margin-top: 6px;
}

/* Image + image grid */
.img-frame {
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
  background: var(--n-callout-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-frame img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--n-gray-bg);
  color: var(--n-gray-tx);
  font-size: 13px;
  font-weight: 500;
}
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 99px;
  background: currentColor;
}
.status-pill.green { background: var(--n-green-bg); color: var(--n-green-tx); }
.status-pill.blue { background: var(--n-blue-bg); color: #1670b3; }
.status-pill.yellow { background: #fdecc8; color: var(--n-yellow-tx); }

/* Help/keyboard-hint */
.kbd {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0,0,0,0.06);
  color: var(--n-text-sec);
  border: 1px solid rgba(0,0,0,0.04);
  vertical-align: 1px;
}

/* Responsiveness */
@media (max-width: 900px) {
  .page { padding: 0 24px 200px; }
  .cover .cover-actions { right: 14px; }
  .columns.cols-2, .columns.cols-3 { grid-template-columns: 1fr; }
  .prop-grid { grid-template-columns: 110px 1fr; }
  :root { --sidebar-w: 240px; }
}
@media (max-width: 700px) {
  .app { grid-template-columns: 0 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 10; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
  .app:not(.sidebar-open) .sidebar { transform: translateX(-100%); }
  .page-title { font-size: 32px; }
  .page-title.serif { font-size: 36px; }
}

/* Hide scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar, .page-scroll::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-thumb, .page-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.10); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.sidebar:hover::-webkit-scrollbar-thumb, .page-scroll:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.16); border: 2px solid transparent; background-clip: padding-box; }

/* Selection */
::selection { background: rgba(35,131,226,0.20); }
