/* Taskly v14 — task cancellation + private projects with nested folders.
   Only these new controls are styled here. Existing theme remains unchanged. */
.project-form-context{display:block;line-height:1.6;font-size:10.5px;opacity:.78;margin-top:-3px;overflow-wrap:anywhere;}
#personalProjectTree{gap:4px;}
.project-tree-row{
  --nest:calc(var(--depth,0) * 11px);
  display:flex;align-items:center;gap:3px;position:relative;min-width:0;
  border:1px solid transparent;border-radius:11px;padding:3px 4px 3px 2px;
  padding-inline-start:var(--nest);
  transition:background-color .18s,border-color .18s;
}
.project-tree-row .project-tree-item{
  flex:1;min-width:0;width:0;display:flex;align-items:center;gap:6px;
  padding:8px 3px!important;background:transparent!important;border:0!important;
  box-shadow:none!important;white-space:nowrap;
}
.project-tree-row .project-tree-count{font-size:10px;flex:none;}
.project-tree-row .project-tree-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.project-tree-row .project-expand{
  flex:0 0 19px;width:19px;height:24px;display:grid;place-items:center;
  padding:0;border:0;background:transparent;color:inherit;border-radius:6px;opacity:.66;
}
.project-tree-row .project-expand:disabled{opacity:0;pointer-events:none;}
.project-tree-row .project-expand svg{width:14px;height:14px;transition:transform .2s ease;transform:rotate(-90deg);}
.project-tree-row .project-expand[aria-label^="بستن"] svg{transform:rotate(0deg);}
.project-tree-actions{display:flex;align-items:center;gap:2px;flex:none;max-width:0;overflow:hidden;opacity:0;transition:max-width .22s,opacity .18s;}
.project-tree-row:hover .project-tree-actions,
.project-tree-row:focus-within .project-tree-actions{max-width:82px;opacity:1;overflow:visible;}
.project-tree-actions button{width:25px;height:27px;display:grid;place-items:center;flex:none;padding:4px;border:1px solid transparent;background:transparent;color:inherit;border-radius:8px;cursor:pointer;}
.project-tree-actions svg{width:14px;height:14px;}
.project-tree-actions button:hover{transform:none!important;}
html[data-theme="dark"] .project-tree-row:hover{background:#1c2540;border-color:#35415f;}
html[data-theme="dark"] .project-tree-row.active{background:linear-gradient(125deg,#373073,#2d2854);border-color:#6259a0;box-shadow:inset 3px 0 0 #8172fb;}
html[data-theme="dark"] .project-tree-row.active .project-tree-item{color:#f5f4ff!important;}
html[data-theme="dark"] .project-tree-actions button:hover{background:#43396d;border-color:#6e60ab;color:#fff;}
html[data-theme="light"] .project-tree-row:hover{background:#f4f3ff;border-color:#e4e2f9;}
html[data-theme="light"] .project-tree-row.active{background:#eeebff;border-color:#d8d1ff;box-shadow:inset 3px 0 0 #6651f8;}
html[data-theme="light"] .project-tree-row.active .project-tree-item{color:#4430c9!important;}
html[data-theme="light"] .project-tree-actions button:hover{background:#ebe7ff;border-color:#d3cbff;color:#4634cd;}
.project-tree-actions button:focus-visible,.project-expand:focus-visible,.project-tree-item:focus-visible{outline:2px solid #8c78eb!important;outline-offset:2px;}
/* A discrete, readable cancelled state for both workspaces. */
.pill.status-cancelled{--skill-rgb:238,102,115;--ink-chip-dark:#ffb6ba;--ink-chip-light:#a02d44;--chip-light:#fff0f1;}
html[data-theme="dark"] .pill.status-cancelled{color:#ffbdc4!important;background:#4d2839!important;border:1px solid #9b455d!important;}
html[data-theme="light"] .pill.status-cancelled{color:#af3c50!important;background:#ffedf0!important;border:1px solid #ffc6d0!important;}
.row-actions-combo{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;}
.row-actions-combo .row-action{width:31px;height:31px;flex:none;}
html[data-theme="dark"] .row-action.cancel-action{color:#ffbdc4!important;border-color:#88455b!important;background:linear-gradient(180deg,#452738,#332537)!important;--skill-rgb:240,104,126;}
html[data-theme="light"] .row-action.cancel-action{color:#ad3e5a!important;border-color:#efb1c1!important;background:linear-gradient(180deg,#fff5f7,#ffeef1)!important;--skill-rgb:226,88,118;}
html[data-theme="dark"] .row-action.restore-action{color:#b4e8d4!important;border-color:#407a69!important;--skill-rgb:45,199,153;}
html[data-theme="light"] .row-action.restore-action{color:#10866f!important;border-color:#a7ddcd!important;--skill-rgb:21,173,130;}
.detail-cta{flex-wrap:wrap;}
.detail-cta #detailCancel{flex:1 1 100%;min-height:37px;}
html[data-theme="dark"] .detail-cta #detailCancel{color:#ffbdc4!important;border-color:#88455b!important;background:linear-gradient(180deg,#452738,#332537)!important;--skill-rgb:240,104,126;}
html[data-theme="light"] .detail-cta #detailCancel{color:#a73555!important;border-color:#efb1c1!important;background:linear-gradient(180deg,#fff5f7,#ffedf1)!important;--skill-rgb:226,88,118;}
html[data-theme="dark"] .detail-cta #detailCancel[data-restore="true"]{color:#b4e8d4!important;border-color:#407a69!important;background:#173e35!important;}
html[data-theme="light"] .detail-cta #detailCancel[data-restore="true"]{color:#107e64!important;border-color:#a7ddcd!important;background:#e3faf0!important;}
.tasks-table .status-cancelled{white-space:nowrap;}
@media(hover:none),(max-width:780px){
  .project-tree-actions{max-width:82px;opacity:1;overflow:visible;}
  .project-tree-row{padding-inline-start:calc(var(--depth,0) * 7px);}
  .project-tree-actions button{width:25px;}
}
@media(min-width:781px){
  .sidebar-collapsed .project-tree-row{justify-content:center;padding:3px!important;}
  .sidebar-collapsed .project-tree-row .project-tree-item{flex:0 0 35px;width:35px;justify-content:center;}
  .sidebar-collapsed .project-tree-row .project-expand,.sidebar-collapsed .project-tree-row .project-tree-actions{display:none!important;}
}
@media(prefers-reduced-motion:reduce){.project-tree-row,.project-tree-actions,.project-expand svg{transition:none!important;}}
/* Reserve button geometry so hovering does not shift the pointer target. */
.project-tree-actions{flex:0 0 79px;width:79px;max-width:none;overflow:visible;opacity:0;pointer-events:none;transition:opacity .16s ease;}
.project-tree-row:hover .project-tree-actions,.project-tree-row:focus-within .project-tree-actions{max-width:none;opacity:1;pointer-events:auto;}
@media(hover:none),(max-width:780px){.project-tree-actions{opacity:1;pointer-events:auto;}}
/* Always visible controls: predictable hit targets for touch, mouse, and keyboard. */
.project-tree-actions,.project-tree-row:hover .project-tree-actions,.project-tree-row:focus-within .project-tree-actions{opacity:1;pointer-events:auto;}
/* Compact per-project menu, following Microsoft To Do's overflow-menu convention. */
.project-menu-trigger{flex:0 0 27px;width:27px;height:28px;padding:5px;border:1px solid transparent;border-radius:8px;display:grid;place-items:center;background:transparent;color:inherit;cursor:pointer;}
.project-menu-trigger svg{width:15px;height:15px;}
.project-menu-trigger.open,.project-menu-trigger:hover{background:rgba(112,96,240,.16);border-color:rgba(140,120,235,.26);}
.project-menu-actions{display:flex;flex-wrap:wrap;gap:5px;justify-content:flex-start;margin:0 0 6px;padding:6px 4px 6px 4px;padding-inline-start:calc(var(--depth,0) * 11px + 6px);border-radius:10px;}
.project-menu-actions button{display:inline-flex;align-items:center;justify-content:center;gap:3px;min-height:30px;padding:5px 8px;border-radius:8px;border:1px solid transparent;font:inherit;font-size:10px;font-weight:750;cursor:pointer;}
.project-menu-actions button svg{width:13px;height:13px;}
html[data-theme="dark"] .project-menu-actions{background:#141c30;border:1px solid #303954;}
html[data-theme="dark"] .project-menu-actions button{background:#232d48;color:#d9e0f7;border-color:#3b4668;}
html[data-theme="dark"] .project-menu-actions .project-menu-danger{color:#ffbbc2;background:#412939;border-color:#734057;}
html[data-theme="light"] .project-menu-actions{background:#f9faff;border:1px solid #e1e4f3;}
html[data-theme="light"] .project-menu-actions button{background:#fff;color:#4f5680;border-color:#e0e3f1;}
html[data-theme="light"] .project-menu-actions .project-menu-danger{color:#b33b56;background:#fff2f5;border-color:#f2cbd4;}
.project-menu-actions button:hover{filter:brightness(1.08);transform:none!important;}
/* Remove superseded three-button rail from layout. */
.project-tree-actions{display:none!important;}
