/* ── Top loading bar (fixed, never shifts layout) ─────────────────── */
.loadingBar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--accent) 40%,
    #81d4fa 60%,
    transparent 100%);
  background-size: 300% 100%;
  animation: loadingBarSweep 1.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes loadingBarSweep {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

:root {
  --bg: #0b0f17;
  --panel: rgba(15, 20, 31, 0.9);
  --panelBorder: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.65);
  --accent: #29b6f6;
  --danger: #ff6b6b;
  --ok: #22c55e;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --searchIconUrl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23A9B4C0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
}

html[data-theme="light"] {
  --bg: #f6f8fc;
  --panel: rgba(255, 255, 255, 0.85);
  --panelBorder: rgba(15, 23, 42, 0.12);
  --text: rgba(15, 23, 42, 0.92);
  --muted: rgba(15, 23, 42, 0.62);
  --accent: #2563eb;
  --danger: #dc2626;
  --ok: #16a34a;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
  --searchIconUrl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
}

/* Light-mode component overrides for contrast */
html[data-theme="light"] .panel {
  background: rgba(248, 250, 252, 0.92);
}

html[data-theme="light"] .brand,
html[data-theme="light"] .toolbar {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .hint {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.20);
  color: rgba(15, 23, 42, 0.70);
}

html[data-theme="light"] .btn,
html[data-theme="light"] .select,
html[data-theme="light"] .input,
html[data-theme="light"] .textarea {
  border-color: rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(15, 23, 42, 0.92);
}

html[data-theme="light"] .btn:hover {
  border-color: rgba(15, 23, 42, 0.26);
  background: rgba(255, 255, 255, 0.98);
}

html[data-theme="light"] .btn.primary {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.10);
}

html[data-theme="light"] .btn.danger {
  border-color: rgba(220, 38, 38, 0.40);
  background: rgba(220, 38, 38, 0.08);
}

html[data-theme="light"] .rf-node {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .rf-node.selected {
  outline-color: rgba(37, 99, 235, 0.55);
}

html[data-theme="light"] .nodeTitle {
  color: rgba(15, 23, 42, 0.92);
}

html[data-theme="light"] .nodeMeta,
html[data-theme="light"] .label,
html[data-theme="light"] .panelHeader .meta {
  color: rgba(15, 23, 42, 0.64);
}

html[data-theme="light"] .badge {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.68);
}

html[data-theme="light"] .memoryNode img {
  border-color: rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% 0%, rgba(41, 182, 246, 0.10), transparent 55%),
              radial-gradient(900px 700px at 90% 20%, rgba(34, 197, 94, 0.08), transparent 55%),
              var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  min-height: 100vh;
}

html[data-theme="light"] body {
  background: radial-gradient(1200px 800px at 20% 0%, rgba(37, 99, 235, 0.10), transparent 55%),
              radial-gradient(900px 700px at 90% 20%, rgba(22, 163, 74, 0.08), transparent 55%),
              var(--bg);
  background-attachment: fixed;
}

body, .brand, .toolbar, .panel, .rf-node {
  transition: background-color 140ms ease-in-out, border-color 140ms ease-in-out, color 140ms ease-in-out, box-shadow 140ms ease-in-out, filter 140ms ease-in-out;
}

#root { min-height: 100vh; }

.app {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 420px;
}

.canvas {
  position: relative;
  height: 100%;
}

.topbar {
  position: absolute;
  z-index: 10;
  left: 16px;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

/* For full-screen pages (Home/Login/Board): keep header in flow and responsive */
.screen > .topbar {
  position: sticky;
  top: 16px;
  left: auto;
  right: auto;
  margin: 16px;
  flex-wrap: wrap;
  z-index: 100;
}

.headerBlock {
  pointer-events: auto;
  width: 100%;
  padding: 0 4px 0 0;
  background: var(--panel);
  border: 1px solid var(--panelBorder);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.desktopOnly { display: flex; }
.mobileOnly { display: none; }

.headerRight {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  min-width: 260px;
}

.headerRight .searchBar {
  flex: 1;
  max-width: 520px;
}

.headerBlock .brand {
  padding: 4px 6px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.headerBlock .brandLogo {
  width: 80px;
  height: 45px;
  flex-shrink: 0;
  border-radius: 8px;
  border-color: rgba(41, 182, 246, 0.25);
  box-shadow: 0 0 8px rgba(41, 182, 246, 0.2);
}

html[data-theme="light"] .headerBlock .brandLogo {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: none;
}

/* Only the mobile actions container should auto-push to the right.
   Desktop menus live inside .headerRight and must stay grouped. */
.headerBlock > .mobileActions,
.headerBlock > .menuWrap {
  margin-left: auto;
}

/* Uniform height for all interactive controls in the header */
.headerBlock .btn,
.headerBlock .select,
.headerBlock .searchInput,
.headerBlock .avatarBtn {
  height: 36px;
  box-sizing: border-box;
}

/* Icon-only buttons and avatar — same square size */
.headerBlock .iconBtn,
.headerBlock .avatarBtn {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  flex-shrink: 0;
}
.headerRight .menuWrap {
  margin-left: 0;
}

.brand {
  pointer-events: auto;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--panelBorder);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brandLink {
  cursor: pointer;
  user-select: none;
}

.brandLink:focus-visible {
  outline: 2px solid rgba(41, 182, 246, 0.55);
  outline-offset: 2px;
}

.brandLogo {
  width: 80px;
  height: 45px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid rgba(41, 182, 246, 0.45);
  box-shadow: 0 0 12px rgba(41, 182, 246, 0.35), 0 6px 18px rgba(0, 0, 0, 0.3);
}

html[data-theme="light"] .brandLogo {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.2), 0 4px 12px rgba(15, 23, 42, 0.15);
}

.brand .title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
  display: flex;
  align-items: center;
  color: var(--accent);
}

html[data-theme="light"] .brand .title {
  color: #2563eb;
}

.brand .subtitle { color: var(--muted); font-size: 12px; }

.toolbar {
  pointer-events: auto;
  margin-left: auto;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--panelBorder);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon {
  display: inline-block;
  vertical-align: middle;
}

.iconBtn {
  padding: 7px;
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.circleBtn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  padding: 0;
}

.menuWrap {
  position: relative;
  display: inline-flex;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 30;
  min-width: 220px;
  padding: 8px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--panelBorder);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 6px;
}

.menu .searchBar {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.menuItem {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.menuIcon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.menuIcon .icon { width: 20px; height: 20px; }

.menuDivider {
  height: 1px;
  background: rgba(255, 255, 255, 0.10);
  margin: 2px 0;
}

.menuTitle {
  font-weight: 700;
  padding: 6px 8px 0 8px;
}

.menuMeta {
  color: var(--muted);
  font-size: 12px;
  padding: 0 8px 6px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.avatarBtn {
  padding: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* No box — just the icon/image, no extra border from .btn */
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.avatarBtn:hover { background: rgba(255,255,255,0.07); border-color: transparent; }

/* Small avatar image in header button */
.avatarImgSm {
  width: 28px;
  height: 28px;
  aspect-ratio: 1/1;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid rgba(41,182,246,0.4);
  display: block;
}

/* Large avatar image in user menu dropdown */
.avatarImgLg {
  width: 44px;
  height: 44px;
  aspect-ratio: 1/1;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid rgba(41,182,246,0.4);
  flex-shrink: 0;
  display: block;
}

/* Fallback circle with initial (kept for menu dropdown only) */
.avatarCircle {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  background: rgba(41, 182, 246, 0.16);
  border: 1px solid rgba(41, 182, 246, 0.35);
  color: var(--text);
}

html[data-theme="light"] .avatarCircle {
  background: rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.28);
}

.mobileActions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

html[data-theme="light"] .brandLink:focus-visible {
  outline-color: rgba(37, 99, 235, 0.55);
}

html[data-theme="light"] .menuDivider {
  background: rgba(15, 23, 42, 0.12);
}

.searchBar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 220px;
  max-width: 520px;
}

.searchInputWrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.searchInputWrap > .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.45;
  pointer-events: none;
}

.searchInput {
  width: 100%;
}

.input.searchInput {
  padding-left: 32px;
}

.searchInput:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  /* Flex so icons and text always stay vertically centred */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
}

.btn:hover { border-color: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.09); }
.btn.primary { border-color: rgba(41, 182, 246, 0.55); background: rgba(41, 182, 246, 0.16); }
.btn.danger { border-color: rgba(255, 107, 107, 0.55); background: rgba(255, 107, 107, 0.14); }

/* Icon inside a btn — already centred by parent flexbox, no hacks needed */
.btn .icon { flex-shrink: 0; }

.select {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

/* Ensure dropdown list items remain readable (some browsers don't theme <option> automatically). */
.select option {
  background: #0b0f17;
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .select option {
  background: #ffffff;
  color: rgba(15, 23, 42, 0.92);
}

.hint {
  pointer-events: auto;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  color: var(--muted);
  font-size: 12px;
}

.panel {
  height: 100%;
  border-left: 1px solid var(--panelBorder);
  background: rgba(10, 13, 20, 0.65);
  backdrop-filter: blur(10px);
  padding: 14px;
  overflow: auto;
}

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panelHeader .name { font-weight: 700; display: flex; align-items: center; gap: 7px; }
.panelHeader .name .icon { opacity: 0.75; flex-shrink: 0; }
.panelHeader .meta { color: var(--muted); font-size: 12px; }
.panelMeta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.panelMeta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.panelMeta .icon { width: 12px; height: 12px; opacity: 0.7; flex-shrink: 0; }

.field { margin-top: 12px; display: grid; gap: 6px; }
.label { color: var(--muted); font-size: 12px; }

.input, .textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
}

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

.muted { color: var(--muted); font-size: 13px; line-height: 1.4; }

.linkBtn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.linkBtn:hover {
  filter: brightness(1.08);
}

.linkBtn:focus-visible {
  outline: 2px solid rgba(41, 182, 246, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}

html[data-theme="light"] .linkBtn:focus-visible {
  outline-color: rgba(37, 99, 235, 0.55);
}

.authCard {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  max-width: 520px;
}

.authActions {
  display: flex;
  justify-content: flex-end;
}

.authLinks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.nav {
  pointer-events: auto;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--panelBorder);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 8px;
}

.screen .nav {
  flex-wrap: wrap;
  flex: 1;
}

.btn.active {
  border-color: rgba(41, 182, 246, 0.55);
  background: rgba(41, 182, 246, 0.16);
}

html[data-theme="light"] .btn.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.10);
}

.screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.screenBody {
  padding: 18px;
  flex: 1;
}

/* Home: allow full-bleed layout (no outer padding/margins) */
.screenBody.homeBody {
  padding: 0 16px 16px;
}

.screenBody.homeBody .welcomeWrap {
  width: 100%;
  margin: 0;
  padding: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panelBorder);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 12px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.spacer { flex: 1; }

.kanban {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

/* ── Resize handle between kanban and graph ──────────────────────── */
.resizeHandle {
  flex-shrink: 0;
  width: 14px;
  align-self: stretch;
  min-height: 100px;
  cursor: col-resize;
  position: relative;
  margin: 0 2px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Thin visible line — very subtle by default */
.resizeHandle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  transition: width 0.2s, background 0.2s, box-shadow 0.2s;
}
/* Grip dots in the centre */
.resizeHandle::after {
  content: "⋮";
  font-size: 14px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.15);
  pointer-events: none;
  transition: color 0.2s;
  user-select: none;
}
.resizeHandle:hover::before,
.resizeHandle:active::before {
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.resizeHandle:hover::after,
.resizeHandle:active::after {
  color: var(--accent);
}

/* Target 5 columns per row; 6th wraps to the next row automatically */
.kanban > .col {
  flex: 1 1 calc(20% - 10px);
  min-width: 220px;
}

/* When the task graph is open alongside the board, stack columns vertically
   so they all fit in the fixed-width left panel (360px). */
.kanban.kanbanSidebar {
  flex-direction: column;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
  gap: 10px;
}

.kanban.kanbanSidebar > .col {
  flex: none;
  width: 100%;
  min-width: 0;
  min-height: auto;
  padding: 10px;
}

.kanban.kanbanSidebar .colHeader {
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.col {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 12px;
  min-height: 360px;
}

html[data-theme="light"] .col {
  border-color: rgba(15, 23, 42, 0.10);
  background: rgba(15, 23, 42, 0.03);
}

.colHeader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.colHeaderDraggable {
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.colHeaderDraggable[draggable="true"] {
  cursor: grab;
}

.colHeaderDraggable[draggable="true"]:active {
  cursor: grabbing;
}

html[data-theme="light"] .colHeader {
  border-bottom-color: rgba(15, 23, 42, 0.10);
}

.colTitle { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.colTitle .icon { opacity: 0.55; flex-shrink: 0; }

/* Uniform height for all controls in the column header action row */
.colHeader .row .btn,
.colHeader .row .pill {
  height: 26px;
  min-width: 26px;
  padding: 0 6px;
  font-size: 12px;
  box-sizing: border-box;
}

.colTitleEditable {
  cursor: text;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background 0.15s;
}
.colTitleEditable:hover { background: rgba(255, 255, 255, 0.08); }
html[data-theme="light"] .colTitleEditable:hover { background: rgba(15, 23, 42, 0.07); }

.colTitleEdit {
  font-weight: 700;
  font-size: inherit;
  padding: 2px 6px;
  border-radius: 6px;
  min-width: 0;
  width: 140px;
}

.colDeleteBtn {
  opacity: 0.4;
  font-size: 11px;
  transition: opacity 0.15s;
}
.colDeleteBtn:hover { opacity: 1; color: var(--danger); }

.col {
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

/* Column being dragged — lifted */
.col.colDragging {
  opacity: 0.3;
  box-shadow: none !important;
}

/* Column that a TASK is being dragged over */
.col.colDragOver {
  border-color: var(--accent);
  background: rgba(41, 182, 246, 0.10);
  box-shadow: 0 0 0 2px var(--accent), inset 0 0 24px rgba(41, 182, 246, 0.08);
}
html[data-theme="light"] .col.colDragOver {
  background: rgba(37, 99, 235, 0.07);
  box-shadow: 0 0 0 2px #2563eb, inset 0 0 20px rgba(37, 99, 235, 0.06);
}

/* Vertical drop indicator between columns */
/* Column drop indicator — pseudo-element so it never shifts layout */
.col.colDropBefore {
  position: relative;
}
.col.colDropBefore::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent), 0 0 32px rgba(41, 182, 246, 0.4);
  animation: colDropPulse 0.5s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 5;
}
/* Drop after last column */
.col.colDropAfter {
  position: relative;
}
.col.colDropAfter::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent), 0 0 32px rgba(41, 182, 246, 0.4);
  animation: colDropPulse 0.5s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 5;
}

@keyframes colDropPulse {
  from { opacity: 0.6; box-shadow: 0 0 10px var(--accent); }
  to   { opacity: 1;   box-shadow: 0 0 28px var(--accent), 0 0 48px rgba(41,182,246,0.35); }
}

/* Sidebar mode: groups stacked vertically — drop indicator on top/bottom */
.kanban.kanbanSidebar .col.colDropBefore::before {
  left: 0; right: 0; top: -6px; bottom: auto;
  width: auto; height: 3px;
}
.kanban.kanbanSidebar .col.colDropAfter::after {
  left: 0; right: 0; top: auto; bottom: -6px;
  width: auto; height: 3px;
}

.colAddBtn {
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  text-align: center;
  opacity: 0.55;
  font-size: 13px;
  border-style: dashed;
  border-radius: 10px;
  transition: opacity 0.15s, background 0.15s;
}
.colAddBtn:hover { opacity: 1; background: rgba(41, 182, 246, 0.07); }
html[data-theme="light"] .colAddBtn:hover { background: rgba(37, 99, 235, 0.06); }

.taskCard {
  background: rgba(15, 20, 31, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 10px;
  display: grid;
  gap: 6px;
  cursor: pointer;
}

html[data-theme="light"] .taskCard {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.14);
}

.taskCard { cursor: pointer; }
.taskCard[draggable="true"] { cursor: grab; }
.taskCard[draggable="true"]:active { cursor: grabbing; }
.kanban.kanbanSidebar .taskCard { cursor: grab; }
.kanban.kanbanSidebar .taskCard:active { cursor: grabbing; }

.taskDragHandle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--muted);
  opacity: 0;
  cursor: grab;
  line-height: 1;
  pointer-events: none;
  transition: opacity 0.15s;
}
.taskCard { position: relative; user-select: none; }
.taskCard:hover .taskDragHandle { opacity: 0.5; }

.taskCard.dragging {
  opacity: 0.3;
  box-shadow: none !important;
}

.dropLine {
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  margin: -2px 4px;
  animation: dropLinePulse 0.6s ease-in-out infinite alternate;
}

@keyframes dropLinePulse {
  from { opacity: 0.7; }
  to   { opacity: 1; box-shadow: 0 0 14px var(--accent); }
}

.taskTitle { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.taskTitle .icon { opacity: 0.55; flex-shrink: 0; }
.taskDesc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

html[data-theme="light"] .pill {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.66);
}

.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 100;
}

.modal {
  width: min(720px, 100%);
  background: var(--panel);
  border: 1px solid var(--panelBorder);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.graphToolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  margin-bottom: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--panelBorder);
}

.graphToolbar .select {
  height: 34px;
}

.graphToolbar .iconBtn {
  height: 34px;
  width: 38px;
}

.graphTip {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .kanban { flex-direction: column; }
  .kanban > .col { min-width: 0; flex: none; width: 100%; }
  .col { min-height: 220px; }
}

/* React Flow node theming */
.rf-node {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 20, 31, 0.90);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(10px);
  color: var(--text);
  position: relative;
}

.rf-node.selected { outline: 2px solid rgba(41, 182, 246, 0.65); }
.rf-node.locked { opacity: 0.55; filter: grayscale(0.2); }

/* Handles: hidden until needed, revealed on hover/select/connecting */
.react-flow__handle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(11, 15, 23, 0.85);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}
.react-flow__node:hover .react-flow__handle,
.react-flow__node.selected .react-flow__handle {
  opacity: 1;
}
.react-flow__handle:hover {
  transform: scale(1.35);
  opacity: 1 !important;
}
/* While actively drawing a connection, show all handles on every node */
.react-flow__renderer.connecting .react-flow__handle {
  opacity: 1;
}
/* Keep preview-canvas handles always visible (they're decorative) */
.previewCanvas .react-flow__handle {
  opacity: 1;
}
html[data-theme="light"] .react-flow__handle {
  border-color: rgba(255, 255, 255, 0.9);
}

.nodeRow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nodeHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nodeChips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  white-space: nowrap;
}

html[data-theme="light"] .chip {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.66);
}

.chip.ok {
  border-color: rgba(34, 197, 94, 0.40);
  background: rgba(34, 197, 94, 0.10);
  color: rgba(34, 197, 94, 0.95);
}

.chip.lock {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.70);
}

.nodeTitleText {
  margin-top: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1px;
}

.nodeBodyText {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.memoryPreview {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 8px;
}

html[data-theme="light"] .memoryPreview {
  border-color: rgba(15, 23, 42, 0.12);
}

.nodeIconBtn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  opacity: 0.85;
}

.nodeIconBtn:hover {
  opacity: 1;
}

.nodeCorner {
  position: absolute;
  top: 8px;
  right: 8px;
}

.nodeTitle {
  width: 180px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.nodeMeta { color: var(--muted); font-size: 12px; margin-top: 6px; }

.taskNode {
  width: 240px;
  padding: 10px 12px;
}

.noteNode {
  width: 240px;
  padding: 10px 12px;
}

.timelineNode {
  width: 240px;
  padding: 10px 12px;
}

.checklistNode {
  width: 260px;
  padding: 10px 12px;
}

.taskNode .checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--ok);
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.badge.ok { border-color: rgba(34, 197, 94, 0.45); color: rgba(34, 197, 94, 0.9); }
.badge.lock { border-color: rgba(255, 107, 107, 0.45); color: rgba(255, 107, 107, 0.9); }

.memoryNode {
  width: 240px;
  padding: 10px 12px;
}

.memoryNode .memoryPreview {
  height: 120px;
}

.milestoneWrap {
  width: 240px;
}

.milestoneNode {
  width: 240px;
  padding: 10px 12px;
}

.milestoneNode > .inner {
  width: 100%;
}

/* Critical path highlighting */
.react-flow__edge-path.critical { stroke: rgba(41, 182, 246, 0.95); filter: drop-shadow(0 0 10px rgba(41, 182, 246, 0.45)); }
.react-flow__edge-path.reference { stroke-dasharray: 5 6; }

/* Mobile layout */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .panel { display: none; }

  .topbar { left: 12px; top: 12px; right: 12px; flex-wrap: wrap; }
  .toolbar { margin-left: 0; width: 100%; justify-content: space-between; }
  .hint { width: 100%; }
}

@media (max-width: 720px) {
  .screen > .topbar { margin: 12px; gap: 8px; }
  .screen > .topbar .headerBlock { width: 100%; }
  .screen > .topbar .hint { order: 6; width: 100%; }

  .screenBody.homeBody {
    padding: 0 12px 12px;
  }

  .desktopOnly { display: none; }
  .mobileOnly { display: inline-flex; margin-left: auto; }
}

/* Desktop hardening: keep right group on one line and never show burger. */
@media (min-width: 721px) {
  .headerBlock { flex-wrap: nowrap; }
  .desktopOnly { display: flex !important; }
  .mobileOnly { display: none !important; }
  .headerRight { min-width: 0; }
}

@media (max-width: 520px) {
  .screen > .topbar .hint { display: none; }
}

.mobileSheet {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 62vh;
  background: rgba(10, 13, 20, 0.86);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.sheetHandle {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.20);
  margin: 0 auto;
}

.dropOverlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(41, 182, 246, 0.10);
  border: 2px dashed rgba(41, 182, 246, 0.35);
  color: rgba(255, 255, 255, 0.90);
  font-weight: 600;
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease-in-out;
}

.dropOverlay.on { opacity: 1; }

/* Welcome / Home */
.welcomeWrap {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.welcomeHero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.welcomeCopy {
  background: var(--panel);
  border: 1px solid var(--panelBorder);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 18px;
}

.welcomeKicker {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.welcomeTitle {
  font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-top: 8px;
}

.welcomeLead {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 64ch;
}

.welcomeCtas {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.welcomeMiniMeta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.welcomePreview {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 14px;
  overflow: hidden;
}

html[data-theme="light"] .welcomePreview {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.10);
}

.previewCanvas {
  position: relative;
  height: 260px;
  border-radius: 18px;
  border: 0;
  overflow: hidden;
  background: transparent;
}

html[data-theme="light"] .previewCanvas {
  background: transparent;
}

/* Home preview uses a read-only React Flow instance */
.homePreviewFlow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.previewCanvas .react-flow {
  width: 100%;
  height: 100%;
  background: transparent;
}

.previewCanvas .react-flow__controls,
.previewCanvas .react-flow__minimap,
.previewCanvas .react-flow__panel {
  display: none !important;
}

.previewCanvas .react-flow__handle {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(41, 182, 246, 0.95);
  border: 2px solid rgba(15, 20, 31, 0.75);
}

html[data-theme="light"] .previewCanvas .react-flow__handle {
  background: rgba(37, 99, 235, 0.90);
  border-color: rgba(255, 255, 255, 0.85);
}

html[data-theme="light"] .previewSvg rect,
html[data-theme="light"] .previewSvg circle {
  fill: rgba(255, 255, 255, 0.92);
  stroke: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .previewSvg text {
  fill: rgba(15, 23, 42, 0.92);
}

.previewCanvas {
  width: 100%;
  margin: 0;
}

/* Make preview nodes match the real graph sizing (avoid tiny fitView). */
.previewCanvas {
  height: 320px;
}

.previewCanvas .taskNode,
.previewCanvas .memoryNode,
.previewCanvas .noteNode,
.previewCanvas .timelineNode,
.previewCanvas .checklistNode,
.previewCanvas .milestoneNode {
  width: 230px;
  padding: 10px 12px;
}

.previewCanvas .nodeTitleText {
  margin-top: 6px;
  font-size: 13px;
}

.previewCanvas .nodeBodyText {
  margin-top: 4px;
  font-size: 12px;
}

.previewCanvas .chip {
  font-size: 11px;
  padding: 2px 7px;
}

.previewCanvas .nodeIconBtn {
  display: none;
}

.previewNode.n1 { left: 18px; top: 24px; width: 140px; }
.previewNode.n2 { left: 86px; top: 120px; width: 150px; border-radius: 999px; text-align: center; }
.previewNode.n3 { left: 210px; top: 52px; width: 150px; transform: rotate(3deg); }

.previewEdge {
  position: absolute;
  height: 2px;
  background: rgba(41, 182, 246, 0.65);
  filter: drop-shadow(0 0 10px rgba(41, 182, 246, 0.25));
}

html[data-theme="light"] .previewEdge {
  background: rgba(37, 99, 235, 0.55);
  filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.18));
}

.previewEdge.e1 { left: 150px; top: 70px; width: 100px; transform: rotate(12deg); }
.previewEdge.e2 { left: 160px; top: 150px; width: 130px; transform: rotate(-10deg); opacity: 0.7; }

.welcomeGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.welcomeCard {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  padding: 14px;
}

html[data-theme="light"] .welcomeCard {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.10);
}

.welcomeCardTitle {
  font-weight: 800;
  font-size: 13px;
}

.welcomeCardText {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.welcomeSteps {
  padding: 12px;
}

.welcomeStepList {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.welcomeStep {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .welcomeHero { grid-template-columns: 1fr; }
  .welcomeGrid { grid-template-columns: 1fr; }
  .previewCanvas { height: 220px; }
}

/* ── Rich Text Editor ─────────────────────────────────────────────────────── */

.richEditor {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.richEditor:focus-within {
  border-color: rgba(41, 182, 246, 0.35);
}

.richToolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  align-items: center;
}

.richBtn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 12px;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  min-width: 26px;
  text-align: center;
  transition: background 80ms, color 80ms, border-color 80ms;
}

.richBtn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.richBtn.active {
  background: rgba(41, 182, 246, 0.14);
  border-color: rgba(41, 182, 246, 0.28);
  color: var(--accent);
}

.richDivider {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 3px;
  flex-shrink: 0;
  align-self: center;
}

.richUrlBar {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  align-items: center;
}

/* ProseMirror content area */
.richContent {
  padding: 10px 12px;
  min-height: 140px;
  max-height: 420px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.65;
  outline: none;
  color: var(--text);
}

.richContent > * + * { margin-top: 0.5em; }
.richContent p { margin: 0; }

.richContent h1 { font-size: 1.45em; font-weight: 700; line-height: 1.2; }
.richContent h2 { font-size: 1.2em; font-weight: 600; line-height: 1.3; }
.richContent h3 { font-size: 1.05em; font-weight: 600; line-height: 1.4; }

.richContent ul,
.richContent ol { padding-left: 1.5em; }
.richContent li + li { margin-top: 0.2em; }

.richContent blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 12px;
  color: var(--muted);
  background: rgba(41, 182, 246, 0.05);
  border-radius: 0 6px 6px 0;
}

.richContent code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.87em;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}

.richContent pre {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 10px 14px;
  overflow-x: auto;
}

.richContent pre code {
  background: none;
  padding: 0;
  font-size: 13px;
}

.richContent a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.richContent a:hover { filter: brightness(1.15); }

.richContent mark {
  background: rgba(250, 204, 21, 0.32);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

.richContent img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: block;
}

.richContent iframe {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: block;
}

/* Placeholder (from @tiptap/extension-placeholder) */
.richContent p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
  float: left;
  height: 0;
}

/* Light mode overrides */
html[data-theme="light"] .richEditor {
  border-color: rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .richEditor:focus-within {
  border-color: rgba(37, 99, 235, 0.4);
}

html[data-theme="light"] .richToolbar,
html[data-theme="light"] .richUrlBar {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.02);
}

html[data-theme="light"] .richBtn:hover {
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.9);
}

html[data-theme="light"] .richBtn.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--accent);
}

html[data-theme="light"] .richDivider {
  background: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .richContent pre {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .richContent code {
  background: rgba(15, 23, 42, 0.07);
}

html[data-theme="light"] .richContent blockquote {
  background: rgba(37, 99, 235, 0.04);
}

html[data-theme="light"] .richContent mark {
  background: rgba(234, 179, 8, 0.28);
}

html[data-theme="light"] .richContent img,
html[data-theme="light"] .richContent iframe {
  border-color: rgba(15, 23, 42, 0.12);
}

/* RichViewer — read-only rendering of stored HTML */
.richContent.richViewer {
  min-height: 0;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0;
  background: transparent;
}

/* Task detail modal */
.taskDetailModal {
  max-width: 680px;
  width: min(680px, 92vw);
  display: flex;
  flex-direction: column;
  max-height: 82vh;
}

.taskDetailBody {
  flex: 1;
  overflow-y: auto;
  margin-top: 14px;
  padding-right: 2px;
}

/* Autosave "Saved" indicator in modal header */
.autosaveSaved {
  color: var(--ok);
}

/* Hint pill — hidden until hover so it doesn't add noise on every card */
.taskCardHint {
  opacity: 0;
  transition: opacity 0.15s;
}
.taskCard:hover .taskCardHint { opacity: 0.6; }

/* ── User menu improvements ─────────────────────────────────────── */
.userMenuHeader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 10px;
}
.avatarCircleLg {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.userMenuInfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.userMenuName { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userMenuEmail { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.roleBadge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, rgba(41,182,246,0.2), rgba(124,58,237,0.2));
  color: var(--accent);
  border: 1px solid rgba(41,182,246,0.3);
  width: fit-content;
  margin-top: 2px;
}
.roleBadgeLg { font-size: 12px; padding: 3px 10px; margin-top: 4px; }
.roleBadgeUser {
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border-color: rgba(255,255,255,0.1);
}
html[data-theme="light"] .roleBadge {
  background: rgba(37,99,235,0.08);
  border-color: rgba(37,99,235,0.25);
}
html[data-theme="light"] .roleBadgeUser {
  background: rgba(15,23,42,0.05);
  border-color: rgba(15,23,42,0.12);
}

/* ── Profile page ────────────────────────────────────────────────── */
.profilePage {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.profileIdentity {
  display: flex;
  align-items: center;
  gap: 20px;
}
.profileAvatarWrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 14px;
  display: block;
}
.profileAvatarWrap:hover .profileAvatarOverlay { opacity: 1; }

.profileAvatar {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profileAvatarInitial {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-weight: 800;
  font-size: 30px;
  box-shadow: 0 0 20px rgba(41,182,246,0.3);
}
.profileAvatarImg {
  object-fit: cover;
  border: 2px solid rgba(41,182,246,0.4);
  box-shadow: 0 0 20px rgba(41,182,246,0.3);
}
.profileAvatarOverlay {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s;
  color: #fff;
}
.profileIdentityInfo { display: flex; flex-direction: column; gap: 4px; }
.profileDisplayName { font-size: 20px; font-weight: 800; }
.profileEmail { color: var(--muted); font-size: 13px; }
.profileSectionTitle {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--panelBorder);
}
.profileSectionTitle.danger { color: var(--danger); border-color: rgba(255,107,107,0.25); }
.profileMsg { font-size: 13px; }
.profileMsg.ok { color: var(--ok); }
.profileMsg.danger { color: var(--danger); }

.dangerZone { border: 1px solid rgba(255,107,107,0.25) !important; }
.dangerZoneRow {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
html[data-theme="light"] .dangerZone { border-color: rgba(220,38,38,0.2) !important; }

/* ── Admin panel ────────────────────────────────────────────────── */
.adminPage {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.adminPageHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.adminStats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.adminStat {
  background: var(--panel);
  border: 1px solid var(--panelBorder);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
}
.adminStatValue { font-size: 28px; font-weight: 800; color: var(--accent); line-height: 1; }
.adminStatLabel { font-size: 12px; color: var(--muted); margin-top: 4px; }

.adminTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.adminTable th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--panelBorder);
  background: rgba(255,255,255,0.02);
}
.adminTable td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--panelBorder);
  vertical-align: middle;
}
.adminTable tr:last-child td { border-bottom: none; }
.adminTable tr.suspendedRow td { opacity: 0.5; }
.adminTable tr:hover td { background: rgba(255,255,255,0.02); }
html[data-theme="light"] .adminTable th { background: rgba(15,23,42,0.02); }
html[data-theme="light"] .adminTable tr:hover td { background: rgba(15,23,42,0.02); }

.adminUserCell { display: flex; align-items: center; gap: 10px; }
.adminUserName { font-weight: 600; }
.adminUserEmail { color: var(--muted); font-size: 12px; }
.adminMeta { color: var(--muted); font-size: 12px; }
.adminActions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.avatarSm { width: 34px !important; height: 34px !important; font-size: 13px !important; }

.statusBadge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.statusActive { background: rgba(34,197,94,0.12); color: var(--ok); border: 1px solid rgba(34,197,94,0.25); }
.statusSuspended { background: rgba(255,107,107,0.12); color: var(--danger); border: 1px solid rgba(255,107,107,0.25); }

@media (max-width: 640px) {
  .adminStats { grid-template-columns: repeat(2, 1fr); }
  .adminTable th:nth-child(2), .adminTable td:nth-child(2) { display: none; }
  .profileIdentity { flex-wrap: wrap; }
}

/* ── Desktop / tablet UX improvements ─────────────────────────────── */

/* sidebar mode columns fill the panel — no cap */
.kanban.kanbanSidebar > .col { max-width: none; }

/* #9 — consistent 34px height for all graph toolbar controls */
.graphToolbar .select,
.graphToolbar .iconBtn,
.graphToolbar .btn { height: 34px; box-sizing: border-box; }
.graphToolbar .iconBtn { width: 34px; padding: 0; }

/* #10 — compact task cards in kanban sidebar mode */
.kanban.kanbanSidebar .taskDesc { display: none; }
.kanban.kanbanSidebar .taskCardHint { display: none; }

/* #11 — slightly larger text in task cards */
.taskTitle { font-size: 14px; }
.taskDesc  { font-size: 13px; }

/* #5 — highlight the task whose graph is currently open */
.taskCard.taskSelected {
  border-color: var(--accent);
  background: rgba(41, 182, 246, 0.08);
  box-shadow: 0 0 0 2px rgba(41, 182, 246, 0.25);
}
html[data-theme="light"] .taskCard.taskSelected {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

/* #4 — empty column placeholder */
.colEmpty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 24px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  pointer-events: none;
}
html[data-theme="light"] .colEmpty {
  border-color: rgba(15, 23, 42, 0.10);
}

/* Desktop: columns fill the full viewport height so the board feels full-screen */
@media (min-width: 901px) { .col { min-height: calc(100vh - 160px); } }
/* Mobile / narrow: columns are content-sized */
@media (max-width: 900px) { .col { min-height: 160px; } }

/* ── Help / FAQ page ─────────────────────────────────────────────────── */
.helpWrap {
  display: grid;
  gap: 10px;
  padding-bottom: 40px;
}

.helpHero { padding: 16px 0 4px; display: grid; gap: 4px; }
.helpHeroTitle { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.helpHeroTitle .icon { opacity: 0.75; }
.helpHeroSub { color: var(--muted); font-size: 14px; }

/* Accordion section */
.helpSection {
  background: var(--panel);
  border: 1px solid var(--panelBorder);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.helpSection:focus-within { box-shadow: 0 0 0 2px rgba(41,182,246,0.25); }

.helpSectionHeader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.helpSectionHeader:hover { background: rgba(255,255,255,0.04); }
html[data-theme="light"] .helpSectionHeader:hover { background: rgba(15,23,42,0.03); }

.helpSectionIcon { font-size: 20px; flex-shrink: 0; }
.helpSectionTitle { font-weight: 700; font-size: 15px; flex: 1; }
.helpChevron { color: var(--muted); transition: transform 0.2s; flex-shrink: 0; }
.helpChevron.open { transform: rotate(90deg); }

.helpSectionBody {
  padding: 4px 16px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 640px) { .helpSectionBody { grid-template-columns: 1fr; } }

.helpTextCol { display: grid; gap: 8px; }
.helpText { display: grid; gap: 6px; }
.helpText p { margin: 0; font-size: 14px; line-height: 1.65; }
.helpText ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 5px; }
.helpText li { font-size: 13px; line-height: 1.5; color: var(--muted); }
.helpText strong { color: var(--text); }

/* Visual panel */
.helpVisual {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--panelBorder);
  border-radius: 12px;
  padding: 16px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
html[data-theme="light"] .helpVisual { background: rgba(15,23,42,0.025); }

/* ── Mini kanban preview ──────────────────────────────────────────── */
.helpMiniKanban { display: flex; gap: 8px; width: 100%; }
.helpMiniCol {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,0.025);
  min-width: 0;
}
html[data-theme="light"] .helpMiniCol { border-color: rgba(15,23,42,0.10); background: rgba(15,23,42,0.02); }
.helpMiniColHeader {
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
html[data-theme="light"] .helpMiniColHeader { border-bottom-color: rgba(15,23,42,0.08); }
.helpMiniCard {
  background: rgba(15,20,31,0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  padding: 5px 7px;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
html[data-theme="light"] .helpMiniCard { background: rgba(255,255,255,0.95); border-color: rgba(15,23,42,0.14); }
.helpMiniCard.accent { border-color: var(--accent); background: rgba(41,182,246,0.08); }
html[data-theme="light"] .helpMiniCard.accent { border-color: #2563eb; background: rgba(37,99,235,0.07); }

/* ── Task card anatomy ────────────────────────────────────────────── */
.helpCardAnatomy { width: 100%; display: grid; gap: 10px; }
.helpAnatomyCard {
  background: rgba(15,20,31,0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 5px;
}
html[data-theme="light"] .helpAnatomyCard { background: rgba(255,255,255,0.95); border-color: rgba(15,23,42,0.14); }
.helpAnatomyTitle { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.helpAnatomyDesc { font-size: 11px; color: var(--muted); line-height: 1.35; }
.helpAnatomyMeta { display: flex; gap: 6px; align-items: center; }
.helpAnatomyLegend { display: flex; gap: 12px; flex-wrap: wrap; }
.helpAnatomyLegendRow { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.helpAnatomyDot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.helpAnatomyDot.accent { background: var(--accent); }
.helpAnatomyDot.muted  { background: rgba(255,255,255,0.30); }
html[data-theme="light"] .helpAnatomyDot.muted { background: rgba(15,23,42,0.30); }
.helpAnatomyDot.pill   { background: rgba(255,255,255,0.14); border-radius: 999px; width: 18px; height: 8px; }

/* ── Drag demo ────────────────────────────────────────────────────── */
.helpDragDemo {
  position: relative;
  width: 100%;
  height: 90px;
  display: flex;
  gap: 10px;
}
.helpDragCol {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.025);
  position: relative;
  overflow: hidden;
}
.helpDragColDrop {
  border-color: var(--accent);
  background: rgba(41,182,246,0.07);
  box-shadow: 0 0 0 1px rgba(41,182,246,0.3) inset;
}
html[data-theme="light"] .helpDragColDrop { background: rgba(37,99,235,0.06); }
.helpDragColLabel { font-size: 10px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.helpDragCard {
  background: rgba(15,20,31,0.9);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  position: absolute;
  top: 26px;
  left: 8px;
  width: calc(50% - 18px);
  animation: helpDragAnim 3.2s ease-in-out infinite;
  transform-origin: center;
}
html[data-theme="light"] .helpDragCard { background: rgba(255,255,255,0.95); border-color: rgba(15,23,42,0.14); }
@keyframes helpDragAnim {
  0%,  18% { transform: translate(0,0) rotate(0deg) scale(1);    opacity: 1; box-shadow: none; }
  32%       { transform: translate(0,-14px) rotate(2deg) scale(1.06); opacity: 0.88; box-shadow: 0 10px 28px rgba(0,0,0,0.5); }
  68%       { transform: translate(calc(100% + 18px),-14px) rotate(2deg) scale(1.06); opacity: 0.88; box-shadow: 0 10px 28px rgba(0,0,0,0.5); }
  82%, 100% { transform: translate(calc(100% + 18px),0) rotate(0deg) scale(1); opacity: 1; box-shadow: none; }
}

/* ── Long-press demo ──────────────────────────────────────────────── */
.helpLongPressDemo { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; }
.helpLongPressCard {
  background: rgba(15,20,31,0.9);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  animation: helpLongPressAnim 3.2s ease-in-out infinite;
}
html[data-theme="light"] .helpLongPressCard { background: rgba(255,255,255,0.95); border-color: rgba(15,23,42,0.14); }
@keyframes helpLongPressAnim {
  0%,  15% { box-shadow: none; border-color: rgba(255,255,255,0.14); opacity: 1; }
  45%       { box-shadow: 0 0 0 3px rgba(41,182,246,0.55); border-color: var(--accent); opacity: 1; }
  65%, 80%  { box-shadow: 0 0 0 3px rgba(41,182,246,0.55); border-color: var(--accent); opacity: 0.30; }
  100%      { box-shadow: none; border-color: rgba(255,255,255,0.14); opacity: 1; }
}
.helpLongPressSteps { display: flex; align-items: center; gap: 4px; justify-content: center; }
.helpLongPressStep {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--panelBorder);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  white-space: nowrap;
}
.helpLongPressStep1 { animation: helpStepFade 3.2s ease-in-out infinite 0s; }
.helpLongPressStep2 { animation: helpStepFade 3.2s ease-in-out infinite 0.3s; border-color: rgba(41,182,246,0.4); color: var(--accent); }
.helpLongPressStep3 { animation: helpStepFade 3.2s ease-in-out infinite 0.6s; }
.helpLongPressArrow { color: var(--muted); font-size: 12px; }
@keyframes helpStepFade {
  0%, 40% { opacity: 0.4; }
  55%, 90% { opacity: 1; }
  100%     { opacity: 0.4; }
}

/* ── Graph preview ────────────────────────────────────────────────── */
.helpGraphPreview {
  width: 100%;
  height: 200px;
  border-radius: 10px;
  overflow: hidden;
}

/* ── Groups visual ────────────────────────────────────────────────── */
.helpGroupRow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
  font-size: 12px;
}
html[data-theme="light"] .helpGroupRow { border-color: rgba(15,23,42,0.10); background: rgba(15,23,42,0.02); }
.helpGroupRow.accent { border-color: rgba(41,182,246,0.30); background: rgba(41,182,246,0.05); }
.helpGroupRow.dashed { border-style: dashed; opacity: 0.7; justify-content: center; }
.helpGroupDot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.helpGroupName { font-weight: 600; flex: 1; }
.helpGroupActions { font-size: 11px; color: var(--muted); letter-spacing: 2px; }

/* ── Keyboard shortcut grid ───────────────────────────────────────── */
.helpKbdGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
@media (max-width: 520px) { .helpKbdGrid { grid-template-columns: 1fr; } }
.helpKbdRow { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.helpKbdLabel { color: var(--muted); flex: 1; font-size: 11px; }
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 2px 0 rgba(0,0,0,0.35);
  white-space: nowrap;
  flex-shrink: 0;
}
html[data-theme="light"] kbd {
  border-color: rgba(15,23,42,0.22);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 2px 0 rgba(15,23,42,0.14);
  color: rgba(15,23,42,0.88);
}
