/* Taskly v15: ONLY the private-project tree and project context menu.
   Smooth nested branches, clear RTL connector rails, root separators,
   and a floating Windows-style action menu. */
#personalProjectTree{
  display:flex;flex-direction:column;gap:4px;
  padding-inline:3px 2px;
  min-width:0;
}
#personalProjectTree .project-node{position:relative;min-width:0;}
#personalProjectTree .project-node.is-root{padding-bottom:0;}
#personalProjectTree .project-tree-row{
  --nest:0px;
  position:relative;display:flex;align-items:center;gap:4px;
  width:100%;min-height:39px;padding:4px 4px!important;
  border:1px solid transparent;border-radius:10px;
  box-shadow:none!important;
  transition:background-color .2s ease,border-color .2s ease;
}
#personalProjectTree .project-tree-row.active,
#personalProjectTree .project-tree-item.active{
  box-shadow:none!important;
}
#personalProjectTree .project-tree-row .project-tree-item{
  flex:1;min-width:0;width:0;display:flex;align-items:center;gap:6px;
  border:0!important;border-radius:7px;padding:5px 1px!important;
  background:transparent!important;box-shadow:none!important;
  font-weight:720;font-size:11.5px;
}
#personalProjectTree .project-tree-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#personalProjectTree .project-expand{
  width:19px;flex:0 0 19px;height:25px;
  display:grid;place-items:center;opacity:.77;cursor:pointer;
}
#personalProjectTree .project-expand svg{width:13px;height:13px;transition:transform .32s cubic-bezier(.2,.85,.2,1);}
#personalProjectTree .project-expand[aria-expanded="false"] svg{transform:rotate(-90deg);}
#personalProjectTree .project-expand[aria-expanded="true"] svg{transform:rotate(0deg);}
#personalProjectTree .project-expand:disabled{opacity:0;pointer-events:none;}
#personalProjectTree .project-tree-count{font-weight:750;font-size:10px;flex:none;}
#personalProjectTree .project-menu-trigger{
  flex:0 0 27px;display:grid;place-items:center;width:27px;height:28px;
  border:1px solid transparent;border-radius:8px;background:transparent;
  cursor:pointer;color:inherit;
}
#personalProjectTree .project-menu-trigger:hover,
#personalProjectTree .project-menu-trigger[aria-expanded="true"]{
  background:rgba(106,92,204,.09);border-color:rgba(103,88,204,.2);
}
#personalProjectTree .project-menu-trigger svg{width:15px;height:15px;}
/* Nested groups stay in the DOM when closed: animate real height, not abrupt rerender. */
#personalProjectTree .project-branch{
  display:grid;grid-template-rows:0fr;
  opacity:0;pointer-events:none;
  transition:grid-template-rows .36s cubic-bezier(.24,.82,.24,1),opacity .26s ease;
}
#personalProjectTree .project-branch.is-expanded{
  grid-template-rows:1fr;opacity:1;pointer-events:auto;
}
#personalProjectTree .project-branch-inner{
  position:relative;min-height:0;min-width:0;overflow:hidden;
  display:flex;flex-direction:column;gap:2px;
  padding-inline-start:16px;
}
/* Connection rail: a vertical stem and L-shaped elbows for the exact parent. */
#personalProjectTree .project-branch-inner::before{
  content:"";position:absolute;
  inset-inline-start:8px;top:0;bottom:21px;
  border-inline-start:1px solid var(--tree-rail);
  pointer-events:none;
}
#personalProjectTree .project-branch-inner > .project-node::before{
  content:"";position:absolute;
  top:21px;inset-inline-start:-8px;
  width:8px;border-top:1px solid var(--tree-rail);
  pointer-events:none;
}
#personalProjectTree .project-node.is-root.has-children.is-expanded{
  padding-bottom:12px;
  margin-bottom:10px;
}
/* A subtle rule BELOW the last visible descendant, before the next root. */
#personalProjectTree .project-node.is-root.has-children.is-expanded::after{
  content:"";position:absolute;bottom:0;right:12px;left:12px;
  height:1px;background:var(--tree-divider);pointer-events:none;
}
html[data-theme="light"] #personalProjectTree{
  --tree-rail:rgba(113,124,157,.36);
  --tree-divider:rgba(143,154,182,.26);
}
html[data-theme="dark"] #personalProjectTree{
  --tree-rail:rgba(143,157,198,.36);
  --tree-divider:rgba(131,146,192,.21);
}
html[data-theme="light"] #personalProjectTree .project-tree-row.active{
  background:rgba(79,57,246,.075)!important;
  border-color:rgba(93,78,220,.2)!important;
}
html[data-theme="dark"] #personalProjectTree .project-tree-row.active{
  background:rgba(110,96,223,.15)!important;
  border-color:rgba(138,126,231,.26)!important;
}
html[data-theme="light"] #personalProjectTree .project-tree-row:hover:not(.active){
  background:rgba(81,98,141,.053)!important;border-color:rgba(122,132,160,.09)!important;
}
html[data-theme="dark"] #personalProjectTree .project-tree-row:hover:not(.active){
  background:rgba(158,168,211,.065)!important;border-color:rgba(135,146,184,.12)!important;
}
/* Floating, right-click-style menu lives outside the scrolling sidebar. */
.project-context-menu{
  position:fixed;z-index:1500;width:190px;min-width:190px;
  padding:6px;border-radius:13px;display:grid;gap:1px;
  direction:rtl;text-align:right;
  box-shadow:0 14px 32px rgba(15,20,43,.15),0 2px 5px rgba(15,20,43,.08);
}
.project-context-menu button{
  display:flex;align-items:center;gap:11px;min-height:37px;
  border:0;border-radius:8px;padding:7px 11px;
  font:inherit;font-size:12px;font-weight:690;
  text-align:right;white-space:nowrap;background:transparent;
  color:inherit;cursor:pointer;
  transition:background .15s ease;
}
.project-context-menu button svg{width:16px;height:16px;flex:none;}
.project-context-menu button:hover{transform:none!important;}
.project-context-menu button:focus-visible{outline:2px solid #8c78eb;outline-offset:-2px;}
.project-context-divider{height:1px;margin:4px 9px;}
html[data-theme="light"] .project-context-menu{
  color:#2e3c59;background:rgba(255,255,255,.97);
  border:1px solid #dee4f0;
  box-shadow:0 12px 30px rgba(35,47,82,.15),0 1px 4px rgba(35,47,82,.08);
}
html[data-theme="light"] .project-context-menu button:hover,
html[data-theme="light"] .project-context-menu button:focus-visible{background:#f1f3fa;}
html[data-theme="light"] .project-context-divider{background:#e5e9f3;}
html[data-theme="light"] .project-context-menu .project-context-danger{color:#bd4354;}
html[data-theme="light"] .project-context-menu .project-context-danger:hover{background:#fff0f2;}
html[data-theme="dark"] .project-context-menu{
  color:#e5eafb;background:#1b2338;
  border:1px solid #37435d;box-shadow:0 18px 38px rgba(1,4,17,.52);
}
html[data-theme="dark"] .project-context-menu button:hover,
html[data-theme="dark"] .project-context-menu button:focus-visible{background:#2c3651;}
html[data-theme="dark"] .project-context-divider{background:#38435c;}
html[data-theme="dark"] .project-context-menu .project-context-danger{color:#ff9fab;}
html[data-theme="dark"] .project-context-menu .project-context-danger:hover{background:#472b3a;}
@media(min-width:781px){
  .sidebar-collapsed #personalProjectTree .project-branch{display:none!important;}
  .sidebar-collapsed #personalProjectTree .project-tree-row{justify-content:center;min-height:40px;padding:3px!important;}
  .sidebar-collapsed #personalProjectTree .project-tree-row .project-tree-item{flex:none;width:35px;justify-content:center;}
  .sidebar-collapsed #personalProjectTree .project-expand,
  .sidebar-collapsed #personalProjectTree .project-menu-trigger{display:none!important;}
}
@media(prefers-reduced-motion:reduce){
  #personalProjectTree .project-branch,#personalProjectTree .project-expand svg,
  .project-context-menu button{transition:none!important;}
}

#personalProjectTree .project-expand:disabled{width:12px;flex-basis:12px;}
