/* ================================================================
   Personal Platform — Admin + Public Theme
   ================================================================ */

/* ---- Variables ---- */
:root {
  --bg: #f8f8f6;
  --surface: #ffffff;
  --surface2: #f2f2f0;
  --border: #e4e4e0;
  --border2: #d0d0cc;
  --fg: #1a1a18;
  --fg2: #4a4a46;
  --fg3: #8a8a85;
  --accent: #2d7d52;
  --accent-hover: #226040;
  --accent-light: #e8f5ee;
  --coral: #c0392b;
  --coral-light: #fdf0ee;
  --warning: #b7860a;
  --warning-light: #fef9e7;
  --blue: #2563eb;
  --blue-light: #eff6ff;
  /* Close to Notion’s web stack (ui-sans-serif + system fallbacks) */
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", sans-serif;
  /* Editor column — Notion-like reading width (overridable via sidebar slider → localStorage) */
  --editor-page-max-width: 708px;
  /* Horizontal breathing room like Notion’s page gutters */
  --editor-gutter-x: max(1.25rem, min(6vw, 5.5rem));
  --editor-inner-pad-x: max(0.75rem, min(3.5vw, 2.75rem));
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10), 0 1px 3px rgba(0,0,0,.06);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--fg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ---- Public layout ---- */
.container { max-width: 720px; margin: 0 auto; padding: 0 1.5rem; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0; }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.site-title { font-weight: 700; font-size: 15px; color: var(--fg); }
.site-nav { display: flex; gap: 1.5rem; font-size: 14px; }
.site-nav a { color: var(--fg2); }
.site-nav a.active, .site-nav a:hover { color: var(--fg); text-decoration: none; }

.site-footer { border-top: 1px solid var(--border); padding: 1.25rem 0; margin-top: 3rem; font-size: 13px; color: var(--fg3); }
.site-footer .container { display: flex; align-items: center; gap: 0.5rem; }
.site-footer-dot { color: var(--border2); }

/* ---- Hero ---- */
.hero { display: flex; gap: 1.25rem; align-items: center; padding: 2.5rem 0 2rem; }
.hero-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero-info h1 { font-size: 1.5rem; font-weight: 700; }
.hero-info p { color: var(--fg2); margin-top: 0.25rem; }
.hero-tags { display: flex; gap: 0.75rem; margin-top: 0.75rem; }
.hero-tags a { font-size: 13px; color: var(--fg2); border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; }
.hero-tags a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---- Sections ---- */
.section { margin-bottom: 2.5rem; padding-top: 1rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.section-head h2 { font-size: 1rem; font-weight: 600; }
.section-head a { font-size: 13px; color: var(--fg3); }

/* ---- Post list ---- */
.post-list { display: flex; flex-direction: column; gap: 0; }
.post-item { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); color: var(--fg); }
.post-item:last-child { border-bottom: none; }
.post-title { font-size: 15px; }
.post-item-excerpt { font-size: 13px; color: var(--fg3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 400px; }
.post-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 12px; color: var(--fg3); white-space: nowrap; flex-shrink: 0; }
.post-tag { background: var(--surface2); border-radius: 3px; padding: 1px 6px; font-size: 11px; }

/* ---- Post single ---- */
.post-header { padding: 2rem 0 1.5rem; }
.post-header h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; }
.post-date { color: var(--fg3); font-size: 13px; margin-top: 0.5rem; }
.post-content { padding-bottom: 2rem; }
.post-content h2 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 0.75rem; }
.post-content h3 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
.post-content p { margin-bottom: 0.875rem; }
.post-content ul, .post-content ol { padding-left: 1.5rem; margin-bottom: 0.875rem; }
.post-content code { font-family: var(--font-mono); font-size: 0.875em; background: var(--surface2); padding: 1px 5px; border-radius: 3px; }
.post-content pre { background: var(--surface2); padding: 1rem; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1rem; }
.post-content pre code { background: none; padding: 0; }
.post-content blockquote { border-left: 3px solid var(--border2); padding-left: 1rem; color: var(--fg2); margin-bottom: 0.875rem; }
.post-content a { text-decoration: underline; }
.post-content img { border-radius: var(--radius); }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 0.35rem; justify-content: center; margin-top: 2rem; }
.pagination a, .pagination span { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--fg2); }
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- Login ---- */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-card { width: 100%; max-width: 380px; padding: 2rem; }
.login-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.login-subtitle { color: var(--fg3); font-size: 13px; margin-bottom: 1.5rem; }

/* ================================================================
   ADMIN LAYOUT
   ================================================================ */

.admin-layout { display: flex; min-height: 100vh; background: var(--bg); }

/* Sidebar */
.admin-sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}
.admin-sidebar.collapsed { width: 56px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0 0.875rem;
  height: 52px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  color: var(--fg);
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-logo-mark { width: 28px; height: 28px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-logo-text { white-space: nowrap; overflow: hidden; transition: opacity 0.15s; }
.admin-sidebar.collapsed .sidebar-logo-text { opacity: 0; width: 0; }

.sidebar-toggle {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem;
  cursor: pointer;
  color: var(--fg3);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
}
.sidebar-toggle:hover { color: var(--fg); background: var(--surface2); }
.sidebar-toggle .toggle-label { white-space: nowrap; overflow: hidden; transition: opacity 0.15s; }
.admin-sidebar.collapsed .sidebar-toggle .toggle-label { opacity: 0; width: 0; }

.sidebar-nav { flex: 1; padding: 0.5rem 0; overflow-y: auto; overflow-x: hidden; }
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg3);
  padding: 0.625rem 0.875rem 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s;
}
.admin-sidebar.collapsed .sidebar-section-label { opacity: 0; height: 0; padding-top: 0; padding-bottom: 0; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.4rem 0.875rem;
  color: var(--fg2);
  font-size: 13.5px;
  border-left: 3px solid transparent;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
}
.sidebar-link:hover { background: var(--surface2); color: var(--fg); text-decoration: none; }
.sidebar-link.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-light); font-weight: 500; }
.sidebar-link .nav-icon { flex-shrink: 0; width: 18px; text-align: center; font-style: normal; font-size: 15px; }
.sidebar-link .nav-label { white-space: nowrap; overflow: hidden; transition: opacity 0.15s; }
.admin-sidebar.collapsed .sidebar-link .nav-label { opacity: 0; width: 0; }

.sidebar-footer { padding: 0.75rem 0.875rem; border-top: 1px solid var(--border); }
.sidebar-footer a { display: flex; align-items: center; gap: 0.5rem; font-size: 12.5px; color: var(--fg3); }
.sidebar-footer a:hover { color: var(--fg); text-decoration: none; }
.admin-sidebar.collapsed .sidebar-footer .nav-label { opacity: 0; width: 0; }

/* Main area */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-content { flex: 1; padding: 1.5rem 2rem; max-width: 1200px; }
.admin-main--edit .admin-content { padding: 0; max-width: none; }

/* ---- Admin Components ---- */
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.admin-header h1 { font-size: 1.25rem; font-weight: 700; }

/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow); }
.card.p-0 { padding: 0; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem 1rem; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--fg3); margin-top: 0.25rem; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; padding: 0.5rem 0.75rem; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg3); border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); }

/* Exported rich tables (item HTML / preview): full grid; generic tbody rules only draw horizontal lines */
.bn-export-rich-table { border-collapse: collapse; width: 100%; }
.bn-export-rich-table td,
.bn-export-rich-table th {
  border: 1px solid rgba(55, 53, 47, 0.22);
  vertical-align: top;
}
.bn-export-rich-table tbody tr:hover td { background: inherit; }

/* Form */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--fg2); margin-bottom: 0.375rem; }
.form-input { width: 100%; padding: 0.45rem 0.625rem; border: 1px solid var(--border2); border-radius: var(--radius); font-size: 14px; background: var(--surface); color: var(--fg); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45,125,82,0.12); }
.form-input::placeholder { color: var(--fg3); }
textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input { cursor: pointer; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.4rem 0.875rem; border-radius: var(--radius); font-size: 13.5px; font-weight: 500; cursor: pointer; border: 1px solid transparent; text-decoration: none; line-height: 1.4; transition: background 0.15s, border-color 0.15s, color 0.15s; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { font-size: 12px; padding: 0.25rem 0.625rem; }
.btn-lg { font-size: 15px; padding: 0.55rem 1.25rem; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--border2); }
.btn-secondary:hover { background: var(--surface2); }
.btn-ghost { background: transparent; color: var(--fg2); border-color: transparent; }
.btn-ghost:hover { background: var(--surface2); color: var(--fg); }
.btn-accent { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-accent:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-danger { background: var(--coral); color: #fff; border-color: var(--coral); }
.btn-danger:hover { background: #a93226; border-color: #a93226; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }

/* Badge */
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 20px; line-height: 1.6; }
.badge-published { background: var(--accent-light); color: var(--accent); }
.badge-draft { background: var(--surface2); color: var(--fg3); border: 1px solid var(--border); }
.badge-synced { background: var(--blue-light); color: var(--blue); }
.badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-error { background: var(--coral-light); color: var(--coral); }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 1rem; }
.alert-success { background: var(--accent-light); color: var(--accent); border: 1px solid #b2d8c4; }
.alert-error { background: var(--coral-light); color: var(--coral); border: 1px solid #f5c6c2; }
.alert-info { background: var(--blue-light); color: var(--blue); border: 1px solid #bfdbfe; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fde68a; }

/* Utilities */
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.375rem; }
.gap-2 { gap: 0.75rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--fg3); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--coral); }
.font-mono { font-family: var(--font-mono); }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--fg3); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state-text { font-weight: 600; font-size: 1rem; margin-bottom: 0.5rem; color: var(--fg2); }

/* ================================================================
   ITEM EDIT PAGE
   ================================================================ */

.item-edit-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* Sticky toolbar */
.item-edit-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}
.item-edit-toolbar .toolbar-back { color: var(--fg3); font-size: 13px; white-space: nowrap; }
.item-edit-toolbar .toolbar-back:hover { color: var(--fg); text-decoration: none; }
.item-edit-toolbar .toolbar-title-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  padding: 0;
  min-width: 0;
}
.item-edit-toolbar .toolbar-title-input::placeholder { color: var(--fg3); }
.toolbar-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* Edit body: editor + sidebar */
.item-edit-body { display: flex; flex: 1; overflow: hidden; }

/* Editor (left) — wider gutters (Notion aligns content with generous side margin) */
.item-edit-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.5rem var(--editor-gutter-x);
  align-items: center;
}

/* Narrow, centered page column (Notion-style) */
.item-edit-main > form,
.item-edit-main > .alert {
  width: 100%;
  max-width: var(--editor-page-max-width);
}
.item-edit-main .editor-shell {
  width: 100%;
  max-width: var(--editor-page-max-width);
}

/* Editor shell */
.editor-shell { flex: 1; display: flex; flex-direction: column; }
.editor-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface2); flex-wrap: wrap; }
.editor-btn { background: none; border: 1px solid transparent; border-radius: 4px; padding: 4px 7px; cursor: pointer; font-size: 13px; color: var(--fg2); font-weight: 600; }
.editor-btn:hover { background: var(--surface); border-color: var(--border); }
.editor-btn.is-active { background: var(--accent-light); color: var(--accent); border-color: transparent; }
.editor-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.editor-content {
  flex: 1;
  min-height: 480px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  outline: none;
  font-size: 16px;
  overflow-y: auto;
}
/* ── Override BlockNote's built-in dark codeBlock wrapper ──────────────────
   BlockNote ships .bn-block-content[data-content-type=codeBlock] with a
   hard-coded #161616 background.  Our custom CodeBlock manages its own bg
   (light or dark), so we clear the wrapper here. */
.editor-content .bn-block-content[data-content-type="codeBlock"] {
  background: transparent !important;
  color: inherit !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

/* ── BlockNote layout ───────────────────────────────────────────────────────
   Only the two outermost containers need min-height.
   DO NOT apply min-height/any layout overrides to inline `bn-*` elements —
   that would inflate the line-height of every paragraph. */
.editor-content .bn-container {
  min-height: inherit;
  display: flex;
  flex-direction: column;
}
.editor-content .bn-editor {
  min-height: inherit;
  padding: 1.25rem var(--editor-inner-pad-x) 2.5rem;
  /* Let BlockNote control its own line-height; don't let body's 1.6 override it */
  line-height: unset;
}

/* Notion-like type scale inside the editor (BlockNote defaults + Inter override) */
.editor-content .bn-container {
  --bn-font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", sans-serif;
  font-size: 16px;
  color: #37352f;
}

/* Heading sizes: see editor.css (editor-overrides.css) — targets real h1–h6 after BlockNote’s em-based wrapper. */

/* Lists: same body size/weight as paragraph (avoid looking like a heading) */
.editor-content .bn-editor .bn-block-content[data-content-type="numberedListItem"],
.editor-content .bn-editor .bn-block-content[data-content-type="bulletListItem"],
.editor-content .bn-editor .bn-block-content[data-content-type="checkListItem"] {
  font-size: 1rem !important;
  font-weight: 400 !important;
}

/* Paragraph / block rhythm — slightly tighter than before */
.editor-content .bn-editor > .bn-block-group > .bn-block-outer {
  margin-bottom: 5px;
}
.editor-content .bn-editor > .bn-block-group > .bn-block-outer:last-child {
  margin-bottom: 0;
}

.editor-content .bn-block-content {
  padding-block: 5px;
}

/*
 * Highlight / colored blocks: rounded card, modest vertical padding.
 */
.editor-content .bn-block:has(> .bn-block-content[data-background-color]) {
  border-radius: 10px;
  padding: 4px 10px 5px;
  box-sizing: border-box;
  overflow: hidden;
}
.editor-content .bn-block:has(> .bn-block-content[data-background-color]) > .bn-block-content {
  padding-block: 2px;
}

/* Centered table + bookmark + equation (custom blocks) */
.editor-content .bn-block-content[data-content-type="table"] {
  display: flex;
  justify-content: center;
  width: 100%;
}
.editor-content .bn-block-content[data-content-type="table"] .tableWrapper {
  width: auto;
  max-width: 100%;
}

.editor-content .bn-block-content[data-content-type="bookmark"] {
  display: flex;
  justify-content: center;
  width: 100%;
}

.editor-content .bn-block-content[data-content-type="equation"] {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-block: 1px;
}

/* Block equation: KaTeX display mode defaults to large vertical margins — tighten */
.editor-content .platform-equation-katex .katex-display {
  margin: 0 !important;
  padding: 0 !important;
}
.editor-content .platform-equation-katex .katex-display > .katex {
  margin: 0 !important;
}
.editor-content .platform-equation-katex .katex {
  margin: 0 !important;
  text-indent: 0;
}
.editor-content .platform-equation-katex {
  line-height: 1.15;
}

/* Equation block: no heavy box — keep selection minimal */
.editor-content .bn-block-content[data-content-type="equation"].ProseMirror-selectednode > .platform-equation-shell,
.editor-content .ProseMirror-selectednode > .bn-block-content[data-content-type="equation"] > .platform-equation-shell {
  outline: 1px solid rgba(55, 53, 47, 0.12) !important;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Slash / suggestion menu: a bit more air under the trigger line */
.editor-content .bn-container [data-floating-ui-portal] .mantine-Paper-root {
  margin-top: 6px;
}

/* ── Prevent global resets from clashing with BlockNote internals ───────────
   The global * reset (margin:0; padding:0) already fires on pre/code.
   BlockNote's own [data-content-type=codeBlock]>pre sets padding:24px which
   has higher specificity, so no additional override is needed here.
   We only need to keep font-family consistent for code elements. */
.editor-content [data-content-type="codeBlock"] pre,
.editor-content [data-content-type="codeBlock"] code {
  font-family: var(--font-mono);
}

/* ── Callout: fill + radius from CalloutBlock inline styles; see editor-overrides.css ── */
.editor-content .bn-block-outer[data-callout] > .bn-block > .bn-block-content {
  background: transparent !important;
}
.editor-content .bn-block-outer[data-callout] > .bn-block > .bn-block-group {
  background: transparent !important;
  padding: 0 10px 6px 40px;
  margin-top: 0;
}
/* Nested block shells stay clear so the callout tint reads as one card */
.editor-content .bn-block-outer[data-callout] .bn-block-group .bn-block-outer {
  background: transparent !important;
}

/* Sidebar (right) */
.item-edit-sidebar {
  width: 280px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  background: var(--surface);
}
.sidebar-card { padding: 1rem; border-bottom: 1px solid var(--border); }
.sidebar-card:last-child { border-bottom: none; }
.sidebar-card-title { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg3); margin-bottom: 0.75rem; }
.sidebar-field { margin-bottom: 0.625rem; }
.sidebar-field label { display: block; font-size: 11.5px; font-weight: 500; color: var(--fg2); margin-bottom: 0.25rem; }
.sidebar-field .form-input { font-size: 13px; padding: 0.35rem 0.5rem; }
.sidebar-field textarea.form-input { min-height: 64px; font-size: 13px; }

/* Page width slider (item edit sidebar) */
input.editor-page-width-range[type="range"] {
  padding: 0.35rem 0;
  height: auto;
  border: none;
  background: transparent;
  cursor: pointer;
}
input.editor-page-width-range[type="range"]::-webkit-slider-thumb {
  cursor: pointer;
}

/* Notion sync panel */
.notion-sync-info { font-size: 12px; color: var(--fg3); }
.notion-sync-info a { color: var(--accent); }

/* ================================================================
   NOTION TABLE
   ================================================================ */
.notion-table-wrap { overflow-x: auto; }
.notion-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.notion-table thead th { padding: 0.45rem 0.625rem; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg3); border-bottom: 2px solid var(--border); white-space: nowrap; background: var(--surface2); }
.notion-table tbody td { padding: 0.4rem 0.625rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.notion-table tbody tr:last-child td { border-bottom: none; }
.notion-table tbody tr:hover td { background: var(--surface2); }
.notion-table .cell-title { font-weight: 500; max-width: 280px; }
.notion-table .cell-title a { color: var(--fg); }
.notion-table .cell-title a:hover { color: var(--accent); text-decoration: none; }
.notion-table .cell-prop { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg2); }
.notion-table .cell-actions { white-space: nowrap; }

/* Collection items header bar */
.collection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.collection-toolbar h1 { font-size: 1.125rem; font-weight: 700; }

/* Notion sync overlay badge in table */
.notion-row-imported { background: var(--accent-light) !important; }

/* Tiptap placeholder */
.ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: var(--fg3);
  pointer-events: none;
  height: 0;
}

/* Article body: nested <ol> from BlockNote HTML export (1. → a. → i. → 1. …) */
.article-content ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin: 0.35rem 0;
}
.article-content ol ol {
  list-style-type: lower-alpha;
}
.article-content ol ol ol {
  list-style-type: lower-roman;
}
.article-content ol ol ol ol {
  list-style-type: decimal;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-content { padding: 1rem; }
  .item-edit-sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .item-edit-toolbar { padding: 0 0.75rem; gap: 0.5rem; }
}
