.board-page {
  padding: 24px 0;
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.board-header-left {
  flex: 1;
  text-align: center;
}

.board-header-right {
  flex-shrink: 0;
  margin-top:38px;
}

.board-title {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.2px;
}

.board-subtitle {
  margin: 6px 0 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.board-primary-btn,
.board-secondary-btn,
.board-danger-btn,
.board-page-btn {
  appearance: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  transition: background-color .15s ease, border-color .15s ease, transform .05s ease;
}

.board-primary-btn {
  border-color: rgba(90, 162, 255, 0.55);
  background: rgba(90, 162, 255, 0.10);
}
.board-primary-btn:hover { border-color: rgba(90, 162, 255, 0.85); background: rgba(90, 162, 255, 0.18); }
.board-primary-btn:active { transform: translateY(1px); }

.board-secondary-btn:hover { border-color: rgba(90, 162, 255, 0.35); background: rgba(90, 162, 255, 0.06); }
.board-secondary-btn:active { transform: translateY(1px); }

.board-danger-btn {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.06);
}
.board-danger-btn:hover { border-color: rgba(239, 68, 68, 0.85); background: rgba(239, 68, 68, 0.12); }
.board-danger-btn:active { transform: translateY(1px); }

.board-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  margin-bottom: 16px;
}

.board-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}
.board-filter-grow { flex: 1 1 280px; }

.board-filter-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
}

.board-select,
.board-input {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
}

.board-textarea {
  resize: vertical;
  min-height: 140px;
}

/* legacy list styles (pre-redesign) removed */

.board-empty {
  border: 1px dashed var(--border);
  background: rgba(148, 163, 184, 0.06);
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
}

.board-pagination {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}
.board-pagination-inner {
  display: flex;
  gap: 10px;
  align-items: center;
}
.board-page-btn.is-disabled {
  opacity: .55;
  cursor: not-allowed;
}
.board-page-current { color: var(--muted); font-weight: 900; }

/* ---------------------------------
 * Board list redesign (table-ish)
 * --------------------------------- */
.board-table {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}

.board-table-head {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 190px;
  gap: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.board-table-body { display: grid; }

.board-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 190px;
  gap: 0;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--border);
  background: transparent;
  position: relative;
  transition: background-color .12s ease;
}
.board-row:first-child { border-top: 0; }
.board-row:hover { background: rgba(148, 163, 184, 0.06); }

.board-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
}
.board-row.is-pinned { background: rgba(90, 162, 255, 0.05); }
.board-row.is-pinned::before { background: rgba(90, 162, 255, 0.75); }

.board-col { min-width: 0; }
.board-col-cat { display:flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.board-col-title { min-width: 0; padding-right: 10px; }
.board-col-stats { display:flex; align-items: flex-start; justify-content: flex-end; }

.board-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}
.board-pill-pinned {
  border-color: rgba(90, 162, 255, 0.55);
  background: rgba(90, 162, 255, 0.12);
}

.board-row-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.2px;
  line-height: 1.35;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-row-meta {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.board-dot { opacity: .85; }

.board-row-excerpt {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-row-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .board-table-head { display: none; }
  .board-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .board-col-stats { justify-content: flex-start; }
  .board-row-stats { flex-direction: row; gap: 10px; align-items: center; }
}

/* ---------------------------------
 * Write page / editor
 * --------------------------------- */
.board-write {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 14px;
}

.board-write-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.board-editor {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}

.board-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  flex-wrap: wrap;
}

.board-tool {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 900;
  cursor: pointer;
}
.board-tool:hover { border-color: rgba(90, 162, 255, 0.35); background: rgba(90, 162, 255, 0.06); }
.board-tool:active { transform: translateY(1px); }
.board-tool.is-active { border-color: rgba(90, 162, 255, 0.65); background: rgba(90, 162, 255, 0.10); }

.board-tool-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

.board-editor-drop-hint {
  padding: 10px 12px;
  border-bottom: 1px dashed var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  background: rgba(148, 163, 184, 0.06);
}

.board-editor-body {
  min-height: 320px;
  padding: 14px;
  outline: none;
  line-height: 1.8;
  color: var(--text);
}

.board-editor-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.board-editor-body h2,
.board-editor-body h3 {
  margin: 18px 0 10px 0;
  line-height: 1.35;
}

.board-write-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.board-write-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

/* Detail page */
.board-detail-page { max-width: 980px; margin: 0 auto; padding: 20px 16px; }
.board-detail-header {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
}
.board-detail-top { display:flex; justify-content: space-between; align-items:center; gap: 12px; }
.board-detail-title { margin: 10px 0 8px 0; font-size: 26px; letter-spacing: -0.3px; }
.board-detail-meta { display:flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-weight: 800; font-size: 13px; }
.board-detail-body { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.board-detail-content { margin: 0; line-height: 1.8; color: var(--text); }
.board-detail-actions { margin-top: 14px; display:flex; gap: 10px; flex-wrap: wrap; align-items:center; }

/* Prose rules for sanitized HTML */
.board-prose { line-height: 1.85; }
.board-prose p { margin: 0 0 12px 0; }
.board-prose p:last-child { margin-bottom: 0; }
.board-prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.board-prose ul, .board-prose ol { margin: 10px 0 12px 22px; }
.board-prose blockquote {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid rgba(90, 162, 255, 0.75);
  background: rgba(90, 162, 255, 0.06);
}
.board-prose pre {
  overflow-x: auto;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.06);
}
.board-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}
.board-prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* Make the back link feel consistent on board pages */
.board-detail-page .updates-more {
  color: var(--muted);
  font-weight: 900;
}
.board-detail-page .updates-more:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.10);
}

/* Modal */
.board-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}
.board-modal {
  width: min(680px, 100%);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 14px;
}
.board-modal-header { display:flex; justify-content: space-between; align-items: center; gap: 12px; }
.board-modal-title { margin: 0; font-size: 18px; }
.board-modal-close {
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.board-modal-close:hover { border-color: rgba(90, 162, 255, 0.35); background: rgba(90, 162, 255, 0.08); }
.board-modal-form { margin-top: 10px; display:flex; flex-direction: column; gap: 12px; }
.board-modal-field { display:flex; flex-direction: column; gap: 6px; }
.board-modal-label { font-size: 13px; color: var(--muted); font-weight: 900; }
.board-modal-actions { display:flex; gap: 10px; flex-wrap: wrap; }
.board-modal-hint { margin: 6px 0 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 720px) {
  .board-header { flex-direction: column; align-items: stretch; }
  .board-filter { min-width: 140px; }
}


