:root {
  --c-bg: #fff;
  --c-text: #1d1d1f;
  --c-text-secondary: #86868b;
  --c-accent: #1d1d1f;
  --c-accent-hover: #333;
  --c-border: #d2d2d7;
  --c-border-light: #e8e8ed;
  --c-bg-glass: rgba(255,255,255,0.72);
  --c-bg-code: #f5f5f7;
  --c-bg-muted: #fafafa;
  --c-bg-hover: #f5f5f7;
  --c-danger: #ff3b30;
  --c-danger-bg: #fff0f0;
  --c-danger-hover-bg: #fff5f5;
  --c-success: #34c759;
  --c-success-bg: #e8f8ed;
  --c-success-text: #1a7d3a;
  --c-warning-bg: #fff8e5;
  --c-warning-text: #996a00;
  --c-tag-bg: #f5f5f7;
  --c-tag-hover-bg: #e8e8ed;
  --c-column-bg: #f2f2f7;
  --c-column-hover-bg: #e8e8ed;
  --c-keyword-bg: #f1f5f9;
  --c-keyword-border: #e2e8f0;
  --c-keyword-text: #475569;
  --c-keyword-remove: #94a3b8;
  --c-blockquote-bg: #f5f5f7;
  --c-blockquote-text: #555;
  --c-btn-hover-bg: #f5f5f7;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.06);
  --max-w: 720px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  --transition: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; }

a { color: var(--c-text); text-decoration: none; transition: color var(--transition); }
a:hover { text-decoration: none; opacity: 0.8; }

/* ── Glass header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-bg-glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--c-border-light);
  padding: 1rem 0;
  margin-bottom: 3rem;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.035em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.12em;
}
.site-title:hover { opacity: 0.75; }
.site-title-light {
  font-weight: 350;
  color: var(--c-text-secondary);
  letter-spacing: -0.015em;
}
.site-icon { font-size: 1.15rem; margin-right: 0.3rem; }

nav { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
nav a {
  margin-left: 1.2rem;
  font-size: 0.82rem;
  font-weight: 450;
  color: var(--c-text-secondary);
  letter-spacing: -0.01em;
  transition: color var(--transition);
  white-space: nowrap;
}
nav a:first-child { margin-left: 0; }
nav a:hover { color: var(--c-text); opacity: 1; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--c-border-light);
  padding: 2.2rem 0;
  margin-top: 5rem;
  text-align: center;
}
.footer-text {
  font-size: 0.82rem;
  font-weight: 420;
  color: var(--c-text-secondary);
  letter-spacing: -0.01em;
}

/* ── Container ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.container-admin { width: 90%; margin: 0 auto; padding: 0 2rem; }

/* ── Article cards ── */
.article-list { list-style: none; }

.article-item {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--c-border-light);
}
.article-item:first-child { padding-top: 0; }
.article-item:last-child { border-bottom: none; }

.article-item h2 {
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.article-item h2 a { color: var(--c-text); }
.article-item h2 a:hover { color: var(--c-text); opacity: 0.7; }

.article-meta {
  font-size: 0.78rem;
  color: var(--c-text-secondary);
  font-weight: 450;
  margin-bottom: 0.5rem;
}
.article-meta span { margin-right: 0.9rem; }

.article-excerpt {
  color: var(--c-text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.column-badge {
  display: inline-block;
  padding: 0.2em 0.65em;
  background: #e8f0fb;
  color: #0071e3;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 550;
  letter-spacing: -0.01em;
}
.column-badge:hover { background: #d0e2f7; opacity: 1; }

.article-tags { margin-top: 0.5rem; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.article-full .article-tags { margin: 2rem 0 1.5rem; }
.tag-badge {
  display: inline-block;
  padding: 0.15em 0.55em;
  background: var(--c-bg-code);
  color: var(--c-text-secondary);
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all var(--transition);
}
.tag-badge:hover { background: var(--c-tag-hover-bg); color: var(--c-text); opacity: 1; text-decoration: none; }

.tags-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.tag-cloud-item { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3em 0.75em; background: var(--c-bg-code); color: var(--c-text-secondary); border-radius: 100px; font-size: 0.85rem; font-weight: 500; text-decoration: none; transition: all var(--transition); }
.tag-cloud-item:hover { background: var(--c-tag-hover-bg); color: var(--c-text); }
.tag-cloud-count { font-size: 0.68rem; color: var(--c-text-secondary); opacity: 0.65; }

/* Tag page */
.tag-header {
  text-align: center;
  padding: 1rem 0 2rem;
}
.tag-header h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -0.03em; }
.tag-header .tag-count { font-size: 0.85rem; color: var(--c-text-secondary); margin-top: 0.3rem; font-weight: 450; }

.article-pinned { }
.pin-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 550;
  color: var(--c-text-secondary);
  letter-spacing: -0.01em;
}

/* ── Article page ── */
.article-full h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--c-text);
}

.article-full .article-meta {
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--c-border-light);
}

.article-content {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--c-text);
}

.article-content h1 { font-size: 1.9rem; margin: 2.8rem 0 0.8rem; font-weight: 700; letter-spacing: -0.035em; color: var(--c-text); }
.article-content h2 { font-size: 1.5rem; margin: 2.2rem 0 0.7rem; font-weight: 600; letter-spacing: -0.03em; }
.article-content h3 { font-size: 1.2rem; margin: 1.8rem 0 0.6rem; font-weight: 600; letter-spacing: -0.025em; }
.article-content h4 { font-size: 1.05rem; margin: 1.4rem 0 0.5rem; font-weight: 600; }

.article-content p { margin-bottom: 1.1rem; }
.article-content ul, .article-content ol { margin-bottom: 1.1rem; padding-left: 1.6rem; }
.article-content li { margin-bottom: 0.35rem; }
.article-content blockquote {
  border-left: 3px solid var(--c-accent);
  margin: 1.4rem 0;
  padding: 0.6rem 1.4rem;
  background: var(--c-bg-code);
  color: #555;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-content pre {
  background: var(--c-bg-code);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
  line-height: 1.55;
  font-family: var(--font-mono);
}
.article-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--c-bg-code);
  padding: 0.15em 0.35em;
  border-radius: 5px;
}
.article-content pre code { background: none; padding: 0; border-radius: 0; }
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.2rem 0;
}
.article-content hr { border: none; border-top: 1px solid var(--c-border-light); margin: 2.5rem 0; }
.article-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.2rem; }
.article-content th, .article-content td {
  border: 1px solid var(--c-border-light);
  padding: 0.55rem 0.8rem;
  text-align: left;
}
.article-content th { background: var(--c-bg-code); font-weight: 600; font-size: 0.85rem; }

/* ── In-article TOC ── */
.article-toc {
  background: var(--c-bg-code);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin-bottom: 2.5rem;
}
.article-toc .toc-title {
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-secondary);
}
.article-toc ol { list-style: none; padding: 0; margin: 0; }
.article-toc li { margin: 0.3rem 0; font-size: 0.88rem; }
.article-toc li.level-2 { padding-left: 0; }
.article-toc li.level-3 { padding-left: 1.3rem; }
.article-toc li.level-4 { padding-left: 2.6rem; }
.article-toc a { color: var(--c-accent); }

/* ── Prev/Next ── */
.prev-next {
  display: flex;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border-light);
  gap: 1.5rem;
}
.prev-next > div { flex: 1; min-width: 0; }
.prev-next a { font-size: 0.88rem; font-weight: 500; word-break: break-word; }
.prev-next .label {
  display: block;
  font-size: 0.7rem;
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-secondary);
  margin-bottom: 0.25rem;
}

/* ── Comments ── */
.comments-section { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--c-border-light); }
.comments-section h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 1.2rem; letter-spacing: -0.02em; }
.comment-list { list-style: none; }
.comment-item { padding: 1rem 0; border-bottom: 1px solid var(--c-border-light); }
.comment-header { display: flex; align-items: center; gap: 0.5rem; }
.comment-author { font-weight: 600; font-size: 0.88rem; }
.comment-date { font-size: 0.72rem; color: var(--c-text-secondary); font-weight: 450; }
.comment-content { margin-top: 0.35rem; font-size: 0.92rem; }
.comment-delete-form { margin-left: auto; display: inline-block; }
.comment-delete-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
  transition: color var(--transition);
}
.comment-delete-btn:hover { color: var(--c-danger); }

/* Keyword blocklist tags */
.keyword-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.keyword-tag { display: inline-flex; align-items: center; gap: 4px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; padding: 2px 8px; font-size: 0.78rem; color: #475569; }
.keyword-remove { border: none; background: none; color: #94a3b8; cursor: pointer; padding: 0 2px; font-size: 1rem; line-height: 1; }
.keyword-remove:hover { color: var(--c-danger); }
details summary { user-select: none; }

/* Inline delete confirmation bubble */
.delete-wrap { position: relative; display: inline-block; }
.comment-delete-wrap { position: relative; display: inline-block; }
.delete-bubble {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  z-index: 200;
  white-space: nowrap;
  animation: bubbleIn 0.15s ease;
}
.delete-bubble .bubble-text { color: var(--c-text); }
.delete-bubble .bubble-yes {
  background: var(--c-danger);
  color: #fff;
  border: none;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 550;
  font-family: inherit;
}
.delete-bubble .bubble-yes:hover { background: #e0332b; }
.delete-bubble .bubble-no {
  background: none;
  border: none;
  color: var(--c-text-secondary);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  padding: 0.25rem 0.3rem;
}
.delete-bubble .bubble-no:hover { color: var(--c-text); }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.95); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.comment-form { margin-top: 1.5rem; }
.comment-form label { display: block; font-size: 0.82rem; font-weight: 550; margin-bottom: 0.3rem; }
.comment-form input, .comment-form textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.comment-form input:focus, .comment-form textarea:focus {
  outline: none;
  border-color: #999;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.comment-form textarea { min-height: 100px; resize: vertical; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 520;
  cursor: pointer;
  background: #fff;
  color: var(--c-text);
  text-decoration: none;
  transition: all var(--transition);
  letter-spacing: -0.01em;
}
.btn:hover { background: var(--c-bg-code); border-color: #c2c2c7; text-decoration: none; opacity: 1; }
.btn-primary { background: var(--c-text); color: #fff; border-color: var(--c-text); }
.btn-primary:hover { background: #333; border-color: #333; }
.btn-block { width: 100%; }
.btn-danger { color: var(--c-danger); border-color: var(--c-danger); }
.btn-danger:hover { background: #fff5f5; }
.btn-sm { padding: 0.3rem 0.72rem; font-size: 0.78rem; border-radius: 6px; }

/* ── Forms ── */
.form-group { margin-bottom: 1.15rem; }
.form-group label { display: block; font-size: 0.84rem; font-weight: 550; margin-bottom: 0.35rem; letter-spacing: -0.01em; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.68rem 0.85rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
}
.form-group textarea { min-height: 400px; resize: vertical; font-family: var(--font-mono); font-size: 0.84rem; line-height: 1.6; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: #999;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

/* ── Admin ── */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.2rem;
}
.admin-header h1 { font-size: 1.45rem; font-weight: 650; letter-spacing: -0.03em; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.75rem 0.8rem; border-bottom: 1px solid var(--c-border-light); vertical-align: middle; }
th { font-weight: 580; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-text-secondary); }
tr:hover td { background: #fafafa; }
td .btn + .btn { margin-left: 0.35rem; }
td form { display: inline-block; vertical-align: middle; }
td .btn { margin-bottom: 0.15rem; }
td .btn, td form { vertical-align: middle; }
.actions-cell {
  white-space: nowrap;
  text-align: right;
}
.actions-cell .btn,
.actions-cell form {
  display: inline-block;
  vertical-align: middle;
}
.actions-cell .btn-toggle {
  min-width: 5.5rem;
  text-align: center;
}
  margin-right: 0.35rem;
}

/* ── Login ── */
.login-form {
  max-width: 380px;
  margin: 4rem auto;
  padding: 2rem;
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.login-form h1 { font-size: 1.35rem; font-weight: 650; margin-bottom: 1.8rem; text-align: center; letter-spacing: -0.03em; }

/* TOTP setup */
.totp-setup { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.totp-manual { flex: 1; min-width: 200px; }

/* ── Search ── */
.search-page { width: 100%; }
.search-hero { padding: 1rem 0 3rem; }
.search-form { width: 100%; }
.search-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}
.search-input {
  flex: 1;
  padding: 0.72rem 1.1rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 450;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
}
.search-input:focus { outline: none; border-color: #999; box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
.search-btn {
  font-weight: 500;
  white-space: nowrap;
}
.search-hint {
  margin-top: 0.8rem;
  font-size: 0.82rem;
  color: var(--c-text-secondary);
  font-weight: 450;
}
.search-results { margin-top: 1rem; }
.search-summary {
  font-size: 0.85rem;
  color: var(--c-text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 450;
}
.search-summary strong { color: var(--c-text); font-weight: 600; }
mark { background: #fff3b0; color: inherit; padding: 0.1em 0.2em; border-radius: 2px; }
.search-empty-hint {
  font-size: 0.9rem;
  color: var(--c-text-secondary);
  margin-top: 0.5rem;
}

/* ── TOC ── */
.columns-jump { display: flex; align-items: center; gap: 0.6rem; margin: 1.25rem 0 2rem; flex-wrap: wrap; }
.columns-jump-label { font-size: 0.78rem; color: var(--c-text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.columns-jump a { display: inline-block; padding: 0.3em 0.85em; border: 1px solid var(--c-border-light); border-radius: 100px; font-size: 0.78rem; color: var(--c-text-secondary); text-decoration: none; transition: all var(--transition); }
.columns-jump a:hover { color: var(--c-text); border-color: var(--c-border); background: var(--c-bg-code); }
.toc-col-arrow { font-size: 0.85rem; color: var(--c-text-secondary); opacity: 0.5; }
.toc-col-arrow:hover { opacity: 1; }

.toc-column-group { margin-bottom: 2.2rem; scroll-margin-top: 5rem; }
.toc-column-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--c-border-light);
  letter-spacing: -0.02em;
}
.toc-article-link { display: flex; align-items: baseline; padding: 0.42rem 0; font-size: 0.94rem; color: var(--c-text); text-decoration: none; }
.toc-article-link { color: var(--c-text); }
.toc-article-link:hover { opacity: 0.7; }
.toc-article-date { flex-shrink: 0; width: 5.5rem; font-size: 0.77rem; color: var(--c-text-secondary); font-weight: 450; }
.toc-uncategorized { opacity: 0.55; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: 0.4rem; margin-top: 2.5rem; }
.pagination a, .pagination span {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--c-border-light);
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 500;
}
.pagination span { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }

/* ── Utilities ── */
.text-center { text-align: center; }
.text-muted { color: var(--c-text-secondary); }
.text-sm { font-size: 0.82rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }
.flex { display: flex; gap: 0.75rem; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.badge { display: inline-block; padding: 0.2em 0.6em; border-radius: 100px; font-size: 0.7rem; font-weight: 550; }
.badge-published { background: #e8f8ed; color: #1a7d3a; }
.badge-draft { background: #fff8e5; color: #996a00; }
.dash-stats { color: var(--c-text-secondary); font-size: 0.82rem; margin-bottom: 1rem; }
.dash-filters { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--c-border-light); flex-wrap: wrap; }
.dash-filter-group { display: flex; gap: 0.25rem; flex-wrap: wrap; align-items: center; }
.dash-filter { display: inline-block; padding: 0.35rem 0.85rem; border-radius: 6px; font-size: 0.8rem; text-decoration: none; color: var(--c-text-secondary); font-weight: 470; transition: all 0.15s; }
.dash-filter:hover { color: var(--c-text); background: var(--c-bg-code); }
.dash-filter.active { color: var(--c-text); background: var(--c-border-light); font-weight: 550; }
.dash-column-select { padding: 0.35rem 0.75rem; border: 1px solid var(--c-border-light); border-radius: 6px; font-size: 0.8rem; color: var(--c-text); background: #fff; cursor: pointer; min-width: 130px; }
.dash-column-select:focus { outline: none; border-color: var(--c-border); }
.col-c { width: 2.5rem; }
.dash-pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; font-size: 0.82rem; color: var(--c-text-secondary); }
.dash-pagination a { color: var(--c-text-secondary); text-decoration: none; padding: 0.2rem 0.5rem; border-radius: 4px; }
.dash-pagination a:hover { color: var(--c-text); background: var(--c-bg-code); }
.dash-page-active { color: var(--c-text); font-weight: 600; padding: 0.2rem 0.5rem; }

/* ── Flash ── */
.flash { padding: 0.65rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.85rem; font-weight: 450; }
.flash-success { background: #e8f8ed; color: #1a7d3a; border: 1px solid #c8f0d2; }
.flash-error { background: #fefce8; color: #8b7300; border: 1px solid #fef08a; }

/* ── Editor ── */
.editor-toolbar { display: flex; gap: 0.35rem; margin-bottom: 0.5rem; }
.editor-toolbar .btn { font-size: 0.76rem; padding: 0.28rem 0.65rem; }
.editor-toolbar .btn.active { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }

/* Editor breaks out of 720px container to fill screen */
.editor-breakout {
  width: 100%;
}
.editor-breakout td { padding: 0.6rem 0.6rem; }
.editor-breakout td:first-child { padding-left: 0; }
.editor-breakout td:last-child { padding-right: 0; }
.editor-breakout th:last-child { text-align: right; }
.editor-breakout td a { color: #0071e3; }
.editor-breakout td a:hover { color: #0077ed; }
@media (max-width: 800px) {
}

.editor-container {
  display: flex;
  gap: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-height: 82vh;
}
.editor-pane {
  width: 50%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.editor-pane textarea {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  border: none;
  padding: 1.2rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
  resize: none;
  outline: none;
  background: #fff;
}
.editor-pane textarea:focus { outline: none; }
.editor-divider {
  width: 1px;
  background: var(--c-border);
  flex-shrink: 0;
}
.preview-pane {
  width: 50%;
  box-sizing: border-box;
  padding: 1.2rem 1.4rem;
  overflow-y: auto;
  background: #fafafa;
}
.preview-pane .article-content { font-size: 0.95rem; }

/* Single-pane modes */
.editor-container.mode-edit .preview-pane,
.editor-container.mode-edit .editor-divider { display: none; }
.editor-container.mode-preview .editor-pane,
.editor-container.mode-preview .editor-divider { display: none; }

/* Tag input */
.tag-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.4rem 0;
  min-height: 2.2rem;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2em 0.55em;
  background: var(--c-bg-code);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--c-text-secondary);
}

.editor-breakout > h1 { margin-bottom: 1.25rem; }

/* Column create row */
.column-create-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.column-create-row input {
  flex: 1;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  min-width: 0;
}
.column-create-row input:focus { outline: none; border-color: #999; box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
.column-create-row .btn { flex-shrink: 0; }

.editor-top-grid { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.editor-top-left, .editor-top-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.editor-top-left .form-group, .editor-top-right .form-group { margin-bottom: 0; }
.editor-top-left input, .editor-top-left select,
.editor-top-right input, .editor-top-right select { width: 100%; box-sizing: border-box; }

.editor-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--c-border-light); flex-wrap: wrap; }
.editor-actions-left { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.editor-actions-right { display: flex; gap: 0.5rem; }
.checkbox-label { font-size: 0.85rem; color: var(--c-text-secondary); cursor: pointer; display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.checkbox-label input[type=checkbox] { width: auto; margin: 0; }
@media (max-width: 600px) {
  .editor-top-grid { flex-direction: column; }
  .editor-top-divider { display: none; }
  .editor-actions { flex-direction: column; align-items: flex-start; }
}

/* File upload in editor */
.upload-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.upload-row input[type="file"] {
  font-family: inherit;
  font-size: 0.84rem;
  padding: 0.35rem 0;
  border: none;
  background: none;
  max-width: 240px;
}
.upload-row input[type="file"]::file-selector-button {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 520;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  margin-right: 0.5rem;
  transition: all var(--transition);
}
.upload-row input[type="file"]::file-selector-button:hover {
  background: var(--c-bg-code);
}
.upload-status-text {
  font-size: 0.78rem;
  color: var(--c-text-secondary);
  font-weight: 450;
}

/* Checkbox labels */
label input[type="checkbox"] {
  width: auto;
  margin-right: 0.45rem;
  accent-color: var(--c-accent);
  vertical-align: middle;
  position: relative;
  top: -1px;
}
label:has(input[type="checkbox"]) {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-weight: 480;
}

/* ── Attachments ── */
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.attachment-card {
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius);
  padding: 0.8rem;
  font-size: 0.83rem;
  background: #fff;
}
.attachment-card img { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; margin-bottom: 0.5rem; }
.attachment-icon { width: 100%; height: 120px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; background: #f8fafc; border-radius: 6px; margin-bottom: 0.5rem; }

/* ── Settings card ── */
.settings-card {
  max-width: 560px;
  margin: 0 auto;
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius);
  padding: 1.5rem 1.8rem;
  background: #fff;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  html { font-size: 15px; }
  .container { padding: 0 1rem; }
  header { position: relative; }
  .article-full h1 { font-size: 1.8rem; }
  .prev-next { flex-direction: column; }
  .prev-next a { max-width: 100%; }
  nav a { margin-left: 0.8rem; font-size: 0.8rem; }
}