    :root {
      --bg-primary: #0f172a;
      --bg-secondary: #1e293b;
      --bg-tertiary: #334155;
      --border-color: rgba(255, 255, 255, 0.1);
      --text-primary: #f8fafc;
      --text-secondary: #94a3b8;
      --accent-color: #3b82f6;
      --accent-glow: rgba(59, 130, 246, 0.4);
      --success-color: #10b981;
      --warning-color: #f59e0b;
      --danger-color: #ef4444;
      --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      background-color: var(--bg-primary);
      color: var(--text-primary);
      font-family: var(--font-sans);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      overflow-x: hidden;
    }

    header {
      background-color: var(--bg-secondary);
      border-bottom: 1px solid var(--border-color);
      padding: 1rem 2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      z-index: 10;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .header-logo {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .header-logo svg {
      width: 32px;
      height: 32px;
      fill: var(--accent-color);
      filter: drop-shadow(0 0 8px var(--accent-glow));
    }

    .header-logo h1 {
      font-size: 1.25rem;
      font-weight: 700;
      letter-spacing: -0.025em;
      background: linear-gradient(to right, #3b82f6, #60a5fa);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

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

    .btn {
      background-color: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      color: var(--text-primary);
      padding: 0.5rem 1rem;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s ease;
    }

    .btn:hover {
      background-color: rgba(255, 255, 255, 0.1);
      border-color: var(--text-secondary);
    }

    .btn-primary {
      background-color: var(--accent-color);
      border-color: var(--accent-color);
    }

    .btn-primary:hover {
      background-color: #2563eb;
      box-shadow: 0 0 12px var(--accent-glow);
    }

    .btn-danger {
      background-color: rgba(239, 68, 68, 0.2);
      border-color: var(--danger-color);
      color: #fca5a5;
    }

    .btn-danger:hover {
      background-color: var(--danger-color);
      color: white;
    }

    .main-container {
      display: flex;
      flex: 1;
      overflow: hidden;
      position: relative;
    }

    .canvas-container {
      flex: 1;
      overflow: auto;
      padding: 3rem;
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
      background-size: 20px 20px;
    }

    /* Isolated root wrappers container */
    .roots-wrapper {
      display: flex;
      gap: 100px;
      align-items: flex-start;
      justify-content: center;
      min-width: max-content;
    }

    /* Sidebar styles */
    .sidebar {
      width: 360px;
      background-color: var(--bg-secondary);
      border-left: 1px solid var(--border-color);
      overflow-y: auto;
      padding: 2rem;
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
      z-index: 5;
      transition: transform 0.3s ease;
    }

    .sidebar.closed {
      transform: translateX(100%);
      position: absolute;
      right: 0;
      height: 100%;
    }

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

    .sidebar-header h2 {
      font-size: 1.1rem;
      font-weight: 600;
    }

    .close-sidebar {
      background: none;
      border: none;
      color: var(--text-secondary);
      font-size: 1.5rem;
      cursor: pointer;
      line-height: 1;
    }

    .close-sidebar:hover {
      color: var(--text-primary);
    }

    /* Empty state */
    .empty-state {
      text-align: center;
      margin: auto;
      max-width: 400px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 15px;
      color: var(--text-secondary);
    }

    .empty-state svg {
      width: 64px;
      height: 64px;
      opacity: 0.3;
    }

    /* CSS Hierarchical Tree Structure */
    .tree {
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .tree ul {
      padding-top: 30px;
      position: relative;
      display: flex;
      justify-content: center;
      gap: 20px;
      padding-left: 0;
    }

    .tree li {
      display: flex;
      flex-direction: column;
      align-items: center;
      list-style-type: none;
      position: relative;
      padding: 30px 10px 0 10px;
    }

    /* Horizontal connection lines */
    .tree li::before, .tree li::after {
      content: '';
      position: absolute;
      top: 0;
      right: 50%;
      border-top: 2px solid var(--bg-tertiary);
      width: 50%;
      height: 30px;
      z-index: 1;
    }

    .tree li::after {
      right: auto;
      left: 50%;
      border-left: 2px solid var(--bg-tertiary);
    }

    /* Disconnect line for single elements */
    .tree li:only-child::after, .tree li:only-child::before {
      display: none;
    }

    .tree li:only-child {
      padding-top: 0;
    }

    /* Disconnect outer connectors */
    .tree li:first-child::before, .tree li:last-child::after {
      border: 0 none;
    }

    /* Add round borders for smooth corners */
    .tree li:last-child::before {
      border-right: 2px solid var(--bg-tertiary);
      border-radius: 0 8px 0 0;
    }

    .tree li:first-child::after {
      border-radius: 8px 0 0 0;
    }

    /* Connector coming down from parent */
    .tree ul ul::before {
      content: '';
      position: absolute;
      top: 0;
      left: 50%;
      border-left: 2px solid var(--bg-tertiary);
      width: 0;
      height: 30px;
      z-index: 1;
    }

    /* Circular Node container */
    .node-element-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      position: relative;
      z-index: 2;
    }

    /* Circular Node styling */
    .node-circle {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #1e293b, #0f172a);
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.05);
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      border: 2px solid rgba(255, 255, 255, 0.05);
      background-size: cover;
      background-position: center;
    }

    .node-circle:hover {
      transform: scale(1.1);
      box-shadow: 0 0 20px var(--accent-glow);
      border-color: rgba(255, 255, 255, 0.2);
    }

    .node-element-wrap.selected .node-circle {
      border-color: var(--accent-color);
      box-shadow: 0 0 25px var(--accent-glow);
      transform: scale(1.08);
    }

    /* SVG Progress Ring */
    .progress-ring {
      position: absolute;
      top: -6px;
      left: -6px;
      width: 92px;
      height: 92px;
      pointer-events: none;
      transform: rotate(-90deg);
    }

    .progress-ring-circle {
      transition: stroke-dashoffset 0.35s;
      transform-origin: 50% 50%;
      stroke: var(--accent-color);
      stroke-linecap: round;
    }

    .progress-ring-bg {
      stroke: rgba(255, 255, 255, 0.06);
    }

    /* Inner percentage text */
    .node-pct {
      font-size: 13px;
      font-weight: 700;
      color: white;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
      background: rgba(15, 23, 42, 0.6);
      padding: 3px 6px;
      border-radius: 10px;
      pointer-events: none;
    }

    /* Label text below circle */
    .node-label {
      margin-top: 14px;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-primary);
      max-width: 130px;
      text-align: center;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      line-height: 1.3;
      text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    }

    /* Floating quick tools on hover */
    .node-hover-actions {
      position: absolute;
      top: -12px;
      left: -24px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease;
      transform: scale(0.9);
      z-index: 10;
    }

    .node-hover-actions::before {
      content: '';
      position: absolute;
      top: -15px;
      bottom: -15px;
      left: -15px;
      right: -25px; /* bridges the gap to the node circle on the right */
      background: transparent;
      z-index: -1;
    }

    .node-element-wrap:hover .node-hover-actions {
      opacity: 1;
      pointer-events: auto;
      transform: scale(1);
    }

    .action-mini-btn {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background-color: var(--bg-secondary);
      border: 1px solid var(--border-color);
      color: var(--text-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 11px;
      transition: all 0.15s ease;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    }

    .action-mini-btn:hover {
      background-color: var(--accent-color);
      color: white;
      transform: scale(1.1);
    }

    .action-mini-btn.delete:hover {
      background-color: var(--danger-color);
    }

    /* Sidebar controls styling */
    .form-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .form-group label {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-secondary);
      font-weight: 600;
    }

    .form-control {
      background-color: var(--bg-primary);
      border: 1px solid var(--border-color);
      color: var(--text-primary);
      padding: 0.6rem 0.8rem;
      border-radius: 6px;
      font-size: 13px;
      transition: border-color 0.2s ease;
      width: 100%;
    }

    .form-control:focus {
      outline: none;
      border-color: var(--accent-color);
    }

    /* Color picker grid */
    .color-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 8px;
    }

    .color-preset {
      height: 32px;
      border-radius: 6px;
      cursor: pointer;
      border: 2px solid transparent;
      transition: transform 0.2s ease;
    }

    .color-preset:hover {
      transform: scale(1.1);
    }

    .color-preset.active {
      border-color: white;
      box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    }

    /* Image upload control */
    .image-picker-wrap {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .image-preview-box {
      width: 50px;
      height: 50px;
      border-radius: 6px;
      border: 1px dashed var(--border-color);
      background-size: cover;
      background-position: center;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-secondary);
      font-size: 10px;
      cursor: pointer;
      overflow: hidden;
    }

    .image-preview-box img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    /* Custom Attributes table */
    .attr-section {
      border-top: 1px solid var(--border-color);
      padding-top: 1.5rem;
      margin-top: 1rem;
    }

    .attr-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
    }

    .attr-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: 250px;
      overflow-y: auto;
    }

    .attr-row {
      display: flex;
      gap: 6px;
      align-items: center;
      background: rgba(255, 255, 255, 0.02);
      padding: 6px;
      border-radius: 6px;
      border: 1px solid rgba(255, 255, 255, 0.04);
    }

    .attr-row input {
      background: transparent;
      border: none;
      color: white;
      font-size: 12px;
      padding: 4px;
      width: 50%;
    }

    .attr-row input:focus {
      background: var(--bg-primary);
      border-radius: 4px;
      outline: none;
    }

    .delete-attr {
      background: none;
      border: none;
      color: var(--danger-color);
      cursor: pointer;
      padding: 4px;
      font-size: 14px;
    }

    .delete-attr:hover {
      color: #fca5a5;
    }

    /* Subtree clone modal */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.6);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 100;
      backdrop-filter: blur(4px);
    }

    .modal-overlay.active {
      display: flex;
    }

    .modal-card {
      background-color: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 1.5rem;
      width: 400px;
      max-width: 90vw;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
    }

    .modal-title {
      font-size: 1.1rem;
      font-weight: 600;
    }

    .modal-options {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .modal-opt-btn {
      background-color: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      color: white;
      padding: 12px;
      border-radius: 8px;
      text-align: left;
      cursor: pointer;
      font-size: 13px;
      transition: all 0.2s ease;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .modal-opt-btn span:first-child {
      font-weight: 600;
    }

    .modal-opt-btn span:last-child {
      font-size: 11px;
      color: var(--text-secondary);
    }

    .modal-opt-btn:hover {
      border-color: var(--accent-color);
      background-color: rgba(59, 130, 246, 0.1);
    }

    .modal-actions {
      display: flex;
      justify-content: flex-end;
    }

    .dropdown-menu {
      display: none;
      position: absolute;
      right: 0;
      top: 100%;
      background: #172237;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      box-shadow: 0 10px 20px rgba(0,0,0,0.5);
      z-index: 2000;
      min-width: 180px;
      margin-top: 4px;
      padding: 4px 0;
    }
    .dropdown-menu button {
      background: none;
      border: none;
      color: white;
      width: 100%;
      text-align: left;
      padding: 10px 16px;
      font-size: 11px;
      font-weight: 500;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
      transition: background 0.15s;
    }
    .dropdown-menu button:hover {
      background: rgba(255, 255, 255, 0.05);
    }
    .dropdown:hover .dropdown-menu {
      display: block;
    }

    /* OKR Tooltip Popover */
    .okr-tooltip-popover {
      position: absolute;
      left: 50%;
      transform: translateX(55px);
      top: -10px;
      background: rgba(14, 22, 38, 0.95);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 8px;
      padding: 14px;
      width: 320px;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(59, 130, 246, 0.25);
      z-index: 1000;
      pointer-events: auto;
      display: none;
      flex-direction: column;
      gap: 10px;
      backdrop-filter: blur(10px);
      font-size: 12px;
      color: var(--text-primary);
    }
    .node-element-wrap:hover .okr-tooltip-popover {
      display: flex;
    }
    .node-element-wrap:hover {
      z-index: 10000 !important;
    }
    .tree li:hover {
      z-index: 999 !important;
    }
    .tree ul:hover {
      z-index: 99 !important;
    }
    
    .node-element-wrap.has-pinned-tooltip,
    .node-element-wrap:has(.okr-tooltip-popover.pinned) {
      z-index: 9998 !important;
    }
    .tree li:has(.okr-tooltip-popover.pinned),
    .tree li:has(.node-element-wrap.has-pinned-tooltip) {
      z-index: 999 !important;
    }
    .okr-tooltip-popover.pinned {
      display: flex !important;
      border-color: var(--success-color) !important;
      box-shadow: 0 0 15px rgba(16, 185, 129, 0.35) !important;
    }
    
    /* Reparenting Mode Styles */
    .reparent-banner {
      position: fixed;
      top: 20px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(14, 22, 38, 0.98);
      border: 1.5px solid #a855f7;
      border-radius: 30px;
      padding: 10px 24px;
      display: flex;
      align-items: center;
      gap: 16px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(168, 85, 247, 0.3);
      z-index: 9999;
      backdrop-filter: blur(12px);
      color: white;
      font-size: 13px;
      font-weight: 500;
      animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes slideDown {
      from { transform: translate(-50%, -50px); opacity: 0; }
      to { transform: translate(-50%, 0); opacity: 1; }
    }
    .reparent-banner-actions {
      display: flex;
      gap: 8px;
    }
    .node-circle.reparenting-source {
      border: 3px dashed #a855f7 !important;
      animation: pulse-purple 1.5s infinite;
    }
    @keyframes pulse-purple {
      0% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7); }
      70% { box-shadow: 0 0 0 15px rgba(168, 85, 247, 0); }
      100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
    }
    .change-parent-active .node-circle:not(.reparenting-source) {
      cursor: pointer;
    }
    .change-parent-active .node-circle:not(.reparenting-source):hover {
      border-color: #a855f7 !important;
      box-shadow: 0 0 15px rgba(168, 85, 247, 0.6) !important;
    }
    .change-parent-active .node-hover-actions,
    .change-parent-active .node-toggle-btn {
      pointer-events: none !important;
      opacity: 0 !important;
    }

    .okr-tooltip-popover h4 {
      font-size: 13px;
      font-weight: 700;
      color: white;
      margin: 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      padding-bottom: 5px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .okr-tooltip-popover h4 .type-badge {
      font-size: 9px;
      padding: 2px 6px;
      border-radius: 10px;
      background: var(--accent-color);
      color: white;
    }
    
    .tooltip-sec-title {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      color: var(--text-secondary);
      letter-spacing: 0.05em;
      margin-bottom: 3px;
    }
    
    .tooltip-sec-content {
      color: #e2e8f0;
      line-height: 1.45;
    }

    .tooltip-attrs-grid {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .tooltip-attr-item {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      border-bottom: 1px dashed rgba(255,255,255,0.04);
      padding-bottom: 2px;
    }

    .tooltip-attr-item span:first-child {
      color: var(--text-secondary);
      font-weight: 500;
    }

    .tooltip-attr-item span:last-child {
      color: white;
      font-weight: 600;
    }
    
    /* Path highlighting */
    .node-circle.path-highlight {
      box-shadow: 0 0 25px var(--success-color) !important;
      border-color: var(--success-color) !important;
      transform: scale(1.08);
    }
    
    .tree li.path-highlight::before, 
    .tree li.path-highlight::after {
      border-color: var(--success-color) !important;
    }

    .tree li.path-highlight > ul::before {
      border-left: 2px solid var(--success-color) !important;
    }

    /* Node toggle button */
    .node-toggle-btn {
      position: absolute;
      top: 71px;
      left: 50%;
      transform: translateX(-50%);
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background-color: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      color: var(--text-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      font-weight: 700;
      cursor: pointer;
      z-index: 12;
      transition: all 0.2s ease;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
      line-height: 1;
      padding: 0;
    }
    .node-toggle-btn:hover {
      background-color: var(--accent-color);
      color: white;
      transform: translateX(-50%) scale(1.15);
      box-shadow: 0 0 8px var(--accent-glow);
    }

    /* Hide progress elements */
    .node-element-wrap.hide-progress .progress-ring {
      display: none !important;
    }
    .node-element-wrap.hide-progress .node-pct {
      display: none !important;
    }

    /* ===== PROJECT MANAGER PANEL ===== */
    .project-panel {
      width: 240px;
      background: var(--bg-secondary);
      border-right: 1px solid var(--border-color);
      display: flex;
      flex-direction: column;
      transition: width 0.3s ease, opacity 0.3s ease;
      overflow: hidden;
      flex-shrink: 0;
      z-index: 4;
    }
    .project-panel.closed {
      width: 0;
      opacity: 0;
      pointer-events: none;
    }
    .project-panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px;
      border-bottom: 1px solid var(--border-color);
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-secondary);
      flex-shrink: 0;
    }
    .project-list {
      flex: 1;
      overflow-y: auto;
      padding: 8px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .project-card {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 10px 12px;
      cursor: pointer;
      transition: all 0.2s;
      position: relative;
    }
    .project-card:hover {
      border-color: var(--accent-color);
      background: rgba(59, 130, 246, 0.08);
    }
    .project-card.active {
      border-color: var(--accent-color);
      background: rgba(59, 130, 246, 0.15);
      box-shadow: 0 0 0 1px var(--accent-color);
    }
    .project-card-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 4px;
      word-break: break-word;
    }
    .project-card-date {
      font-size: 10px;
      color: var(--text-secondary);
      margin-bottom: 6px;
    }
    .project-card-actions {
      display: flex;
      gap: 4px;
      justify-content: flex-end;
    }
    .project-card-actions button {
      background: none;
      border: 1px solid var(--border-color);
      color: var(--text-secondary);
      border-radius: 4px;
      padding: 2px 6px;
      font-size: 11px;
      cursor: pointer;
      transition: all 0.2s;
    }
    .project-card-actions button:hover {
      background: var(--bg-tertiary);
      color: var(--text-primary);
      border-color: var(--text-secondary);
    }

    /* Lang toggle btn active state */
    #lang-toggle-btn {
      min-width: 32px;
      text-align: center;
      justify-content: center;
    }

