/* ========================================================================
   board.css — Canvas Node Graph Board
   Linked after canvas.css; inherits all CSS custom properties from :root.

   Token reference (from tokens.json / canvas.css :root):
     Backgrounds: --bg-sidebar, --bg, --bg-card, --bg-elevated, --border, --border-hover
     Green:       --kai, --kai-dim, --kai-muted, --kai-ghost
     Text:        --text, --text-secondary, --text-muted
     Fonts:       --sans, --mono
     Radius:      --radius-sm (4px), --radius (8px), --radius-lg (12px), --radius-pill
     Semantic:    --destructive, --warning, --info
   ======================================================================== */

/* ------------------------------------------------------------------------
   Global Overrides
   ------------------------------------------------------------------------ */

body {
  margin: 0;
  overflow: hidden;
}

/* Remove the gallery dot-matrix (we render our own on the workspace) */
body::before {
  display: none;
}

/* ------------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------------ */

.board-topbar {
  height: 48px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
  position: relative;
}

.board-layout {
  display: flex;
  height: calc(100vh - 48px);
  overflow: hidden;
  position: relative;
}

.board-sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
  overflow: hidden;
}

.board-sidebar.collapsed {
  width: 0;
  border-right-width: 0;
}

/* Expand tab — visible only when sidebar is collapsed */
.sidebar-expand {
  display: none;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  width: 20px;
  height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 48px;
  text-align: center;
  transition: color 0.15s, background 0.15s;
}

.sidebar-expand:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.board-sidebar.collapsed ~ .sidebar-expand {
  display: block;
}

.board-workspace {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

/* Levric dot-matrix pattern on the workspace */
.board-workspace::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(64, 73, 100, 0.30) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* SVG sits above the dot pattern */
#board-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
}

/* ------------------------------------------------------------------------
   Top Bar Elements
   ------------------------------------------------------------------------ */

.board-back {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.board-back:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.board-name-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--sans);
  padding: 4px 8px;
  outline: none;
  flex: 1;
  min-width: 0;
  max-width: 300px;
  transition: border-color 0.15s ease;
}

.board-name-input:hover {
  border-color: var(--border);
}

.board-name-input:focus {
  border-color: var(--kai-dim);
  background: var(--bg-elevated);
}

.board-name-input::placeholder {
  color: var(--text-muted);
}

.board-save-status {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-muted);
}

.board-topbar-spacer {
  flex: 1;
  min-width: 0;
}

/* Board tabs */
.board-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  max-width: 50vw;
  scrollbar-width: none;
}

.board-tabs::-webkit-scrollbar {
  display: none;
}

.board-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  max-width: 180px;
  transition: all 0.12s ease;
}

.board-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-elevated);
}

.board-tab.active {
  color: var(--text);
  background: var(--bg-elevated);
  border-color: var(--border);
}

.board-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-tab-close {
  display: none;
  font-size: 14px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
  border-radius: 2px;
  flex-shrink: 0;
}

.board-tab:hover .board-tab-close {
  display: block;
}

.board-tab-close:hover {
  color: var(--destructive);
  background: rgba(255, 80, 80, 0.12);
}

.board-tab-close.armed {
  display: block;
  color: var(--destructive);
  background: rgba(255, 80, 80, 0.18);
  font-weight: 700;
}

.board-tab-rename {
  background: var(--bg);
  border: 1px solid var(--kai-dim);
  border-radius: 3px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 500;
  padding: 1px 4px;
  outline: none;
  width: 120px;
}

.board-tab-new {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--kai);
  font-size: 16px;
  font-weight: 500;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.board-tab-new:hover {
  background: var(--kai-ghost);
  border-color: var(--kai-muted);
}

/* ------------------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------------------ */

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.sidebar-collapse {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.sidebar-collapse:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.sidebar-search {
  padding: 8px 10px;
  flex-shrink: 0;
}

.sidebar-search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.sidebar-search input::placeholder {
  color: var(--text-muted);
}

.sidebar-search input:focus {
  border-color: var(--kai-dim);
}

.sidebar-filters {
  display: flex;
  gap: 3px;
  padding: 0 10px 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.sidebar-filter-pill {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 10px;
  font-family: var(--sans);
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

.sidebar-filter-pill:hover {
  color: var(--text-secondary);
  border-color: var(--border-hover);
}

.sidebar-filter-pill.active {
  color: var(--kai);
  border-color: var(--kai-dim);
  background: var(--kai-ghost);
}

.sidebar-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-empty {
  text-align: center;
  padding: 24px 12px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------------------
   Sidebar Items (Draggable)
   ------------------------------------------------------------------------ */

.sidebar-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: grab;
  overflow: hidden;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-item:hover {
  border-color: var(--border-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-item:active {
  cursor: grabbing;
}

.sidebar-item-thumb {
  width: 100%;
  height: 72px;
  object-fit: cover;
  display: block;
  background: var(--bg);
}

.sidebar-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: #181c2a;
}

.sidebar-item-name {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text-muted);
  padding: 5px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar scrollbar */
.sidebar-items::-webkit-scrollbar { width: 4px; }
.sidebar-items::-webkit-scrollbar-track { background: transparent; }
.sidebar-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar-items::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ------------------------------------------------------------------------
   Board Nodes (SVG)
   ------------------------------------------------------------------------ */

.board-node {
  cursor: move;
}

/* Image node background */
.board-node rect.node-bg {
  fill: var(--bg-card);
  stroke: var(--border);
  stroke-width: 1;
}

/* Text node background — uses elevated to distinguish from image nodes */
.board-node rect.node-bg.text-bg {
  fill: var(--bg-elevated);
  stroke: var(--border);
}

/* Selected state */
.board-node.selected rect.node-bg {
  stroke: var(--kai);
  stroke-width: 2;
}

/* Node label text */
.board-node .node-label {
  font-family: var(--sans);
  font-size: 11px;
  fill: var(--text-secondary);
}

.board-node .node-type-label {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--text-muted);
  text-transform: uppercase;
}

/* Text node content (foreignObject HTML inside SVG) */
.node-text-content {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 10px 12px;
  outline: none;
  word-break: break-word;
  background: transparent;
  min-height: 30px;
  box-sizing: border-box;
}

.node-text-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  font-style: italic;
  pointer-events: none;
}

.node-text-content:focus {
  background: var(--bg-sidebar);
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------------------
   Sticky Notes
   Muted dark-mode colors that fit the Levric palette.
   Each color has a bg fill and a text accent.
   ------------------------------------------------------------------------ */

.sticky-bg {
  stroke-width: 1;
}

/* Sticky color palette — dark-mode muted tones */
.sticky-yellow  { fill: #3a3520; stroke: #6b6230; }
.sticky-green   { fill: #1e3528; stroke: #2e5a40; }
.sticky-blue    { fill: #1e2a3a; stroke: #2e4a6b; }
.sticky-pink    { fill: #3a1e2e; stroke: #6b2e50; }
.sticky-orange  { fill: #3a2a1a; stroke: #6b4a2a; }

/* Selected sticky */
.board-node.selected .sticky-bg {
  stroke: var(--kai);
  stroke-width: 2;
}

/* Sticky content text */
.sticky-content {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  padding: 10px 12px;
  outline: none;
  word-break: break-word;
  background: transparent;
  min-height: 30px;
  box-sizing: border-box;
}

.sticky-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  font-style: italic;
  pointer-events: none;
}

.sticky-content:focus {
  border-radius: var(--radius-sm);
}

/* Color dot — click to cycle */
.sticky-color-dot {
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.board-node:hover .sticky-color-dot {
  opacity: 1;
}

circle.sticky-color-dot.sticky-yellow  { fill: #d4b84a; }
circle.sticky-color-dot.sticky-green   { fill: #4aad6a; }
circle.sticky-color-dot.sticky-blue    { fill: #4a8ad4; }
circle.sticky-color-dot.sticky-pink    { fill: #d44a80; }
circle.sticky-color-dot.sticky-orange  { fill: #d48a4a; }

/* Connection ports — styled via CSS, not inline attributes */
.board-port {
  fill: var(--bg-elevated);
  stroke: var(--kai);
  stroke-width: 2;
  opacity: 0;
  transition: opacity 0.15s ease;
  cursor: crosshair;
}

.board-node:hover .board-port {
  opacity: 1;
}

.board-port:hover {
  fill: var(--kai);
}

/* While dragging a connection, show all ports on every node */
#board-svg.connecting .board-port {
  opacity: 1;
}

/* ------------------------------------------------------------------------
   Edges (SVG)
   ------------------------------------------------------------------------ */

.board-edge {
  fill: none;
  stroke: var(--border-hover);
  stroke-width: 2;
  marker-end: url(#arrowhead);
  cursor: pointer;
}

.board-edge:hover {
  stroke: var(--text-muted);
}

.board-edge.selected {
  stroke: var(--kai);
  marker-end: url(#arrowhead-active);
}

.board-edge-hitarea {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  cursor: pointer;
}

.board-edge-label-bg {
  fill: var(--bg-card);
  stroke: var(--border);
  stroke-width: 1;
}

.board-edge-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.board-edge-label:hover {
  fill: var(--text);
}

.board-temp-edge {
  fill: none;
  stroke: var(--kai);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  pointer-events: none;
}

.board-selection-box {
  fill: rgba(35, 172, 98, 0.06);
  stroke: var(--kai);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

/* ------------------------------------------------------------------------
   Edge Label Editing (Absolute over SVG)
   ------------------------------------------------------------------------ */

.edge-label-input {
  position: absolute;
  z-index: 20;
  background: var(--bg-elevated);
  border: 1px solid var(--kai-dim);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 8px;
  outline: none;
  min-width: 120px;
  text-align: center;
}

/* Edge label suggestions */
.edge-label-suggestions {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 280px;
}

.edge-label-suggestion {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.edge-label-suggestion:hover {
  color: var(--kai);
  border-color: rgba(35, 172, 98, 0.4);
  background: rgba(35, 172, 98, 0.08);
}

/* ------------------------------------------------------------------------
   Groups (SVG)
   ------------------------------------------------------------------------ */

.board-group { pointer-events: all; cursor: default; }
.group-bg { stroke-width: 1.5; stroke-dasharray: 6 3; }

.group-green  { fill: rgba(35, 172, 98, 0.06); stroke: rgba(35, 172, 98, 0.3); }
.group-blue   { fill: rgba(74, 138, 212, 0.06); stroke: rgba(74, 138, 212, 0.3); }
.group-pink   { fill: rgba(212, 74, 128, 0.06); stroke: rgba(212, 74, 128, 0.3); }
.group-orange { fill: rgba(212, 138, 74, 0.06); stroke: rgba(212, 138, 74, 0.3); }
.group-yellow { fill: rgba(212, 184, 74, 0.06); stroke: rgba(212, 184, 74, 0.3); }

.board-group.selected .group-bg { stroke-width: 2; stroke-dasharray: none; }

.group-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: text;
}

.group-label-green  { fill: rgba(35, 172, 98, 0.7); }
.group-label-blue   { fill: rgba(74, 138, 212, 0.7); }
.group-label-pink   { fill: rgba(212, 74, 128, 0.7); }
.group-label-orange { fill: rgba(212, 138, 74, 0.7); }
.group-label-yellow { fill: rgba(212, 184, 74, 0.7); }

/* ------------------------------------------------------------------------
   Selection Toolbar
   ------------------------------------------------------------------------ */

.board-selection-toolbar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.sel-toolbar-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-right: 4px;
}

.sel-toolbar-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.sel-toolbar-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.sel-toolbar-btn.sel-group:hover {
  color: var(--kai);
  border-color: rgba(35, 172, 98, 0.4);
}

.sel-toolbar-btn.sel-delete:hover {
  color: #e5534b;
  border-color: rgba(229, 83, 75, 0.4);
}

.sel-toolbar-btn.sel-color:hover {
  color: var(--kai);
  border-color: rgba(35, 172, 98, 0.4);
}

/* ------------------------------------------------------------------------
   Zoom Controls
   ------------------------------------------------------------------------ */

.board-zoom {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  z-index: 5;
}

.zoom-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 13px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.zoom-btn:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.zoom-level {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-muted);
  min-width: 42px;
  text-align: center;
  user-select: none;
}

.zoom-fit {
  font-size: 11px;
  width: auto;
  padding: 0 8px;
}

/* ------------------------------------------------------------------------
   Empty State
   ------------------------------------------------------------------------ */

.board-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 1;
}

.board-empty-icon {
  width: 48px;
  height: 48px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--text-muted);
  font-size: 20px;
}

.board-empty h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.board-empty p {
  font-size: 12px;
  color: var(--text-muted);
}

.board-empty.hidden {
  display: none;
}

/* ------------------------------------------------------------------------
   Board List Overlay
   ------------------------------------------------------------------------ */

.board-list-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 32, 0.8);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.board-list-overlay.active {
  display: flex;
}

.board-list-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 440px;
  width: 90%;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.board-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.board-list-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.board-list-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.board-list-close:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.board-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.board-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 6px;
}

.board-list-item:hover {
  border-color: var(--kai-dim);
  background: var(--bg-card);
}

.board-list-item:last-child {
  margin-bottom: 0;
}

.board-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.board-item-meta {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text-muted);
}

.board-item-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  opacity: 0.4;
}

.board-list-item:hover .board-item-delete {
  opacity: 1;
}

.board-item-delete:hover {
  color: var(--destructive);
  background: rgba(239, 68, 68, 0.1);
}

.board-list-empty {
  text-align: center;
  padding: 32px 16px;
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Share UI --- */

.board-share-btn {
  background: var(--kai-ghost);
  border: 1px solid var(--kai-dim);
  color: var(--kai);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.15s ease;
}
.board-share-btn:hover {
  background: var(--kai-muted);
}
.board-share-btn.shared {
  background: var(--kai);
  color: #fff;
  border-color: var(--kai);
}

/* Share popover */
.share-popover {
  position: fixed;
  top: 48px;
  right: 16px;
  width: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 100;
  padding: 16px;
}
.share-popover-content p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.share-note {
  font-size: 11px !important;
  color: var(--text-muted) !important;
}
.share-publish-btn {
  width: 100%;
  background: var(--kai);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.share-publish-btn:hover { background: var(--kai-dim); }
.share-publish-btn:disabled { opacity: 0.5; cursor: default; }
.share-url-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.share-url {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  font-size: 11px;
  font-family: var(--mono);
  outline: none;
}
.share-copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
}
.share-copy-btn:hover { background: var(--bg-elevated); color: var(--text); }
.share-stats {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-bottom: 10px;
}
.share-actions {
  display: flex;
  gap: 6px;
}
.share-action-btn {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
}
.share-action-btn:hover { background: var(--bg-elevated); color: var(--text); }
.share-action-btn.share-danger:hover { color: var(--destructive); border-color: var(--destructive); }

/* Board comments panel */
.board-comments-panel {
  position: fixed;
  top: 48px;
  right: 0;
  bottom: 0;
  width: 340px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.comments-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.comments-panel-header h3 {
  font-size: 14px;
  font-weight: 600;
}
.comments-panel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}
.comments-panel-close:hover { color: var(--text); }
.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comments-list::-webkit-scrollbar { width: 4px; }
.comments-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.comment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.comment-card.owner-reply {
  border-left: 2px solid var(--kai);
  margin-left: 12px;
}
.comment-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.comment-card-author {
  font-weight: 600;
  color: var(--text-secondary);
}
.comment-card-node {
  font-size: 10px;
  color: var(--info);
}
.comment-card-body {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}
.comment-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.comment-card-action {
  font-size: 10px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
}
.comment-card-action:hover { color: var(--kai); }
.comments-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 32px 16px;
}
